DROP TABLE IF EXISTS tng_people;
CREATE TABLE `tng_people` (
  `ID` int NOT NULL AUTO_INCREMENT,
  `gedcom` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `personID` varchar(22) COLLATE utf8mb4_unicode_ci NOT NULL,
  `lnprefix` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL,
  `lastname` varchar(127) COLLATE utf8mb4_unicode_ci NOT NULL,
  `firstname` varchar(127) COLLATE utf8mb4_unicode_ci NOT NULL,
  `birthdate` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `birthdatetr` date NOT NULL,
  `sex` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL,
  `birthplace` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `deathdate` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `deathdatetr` date NOT NULL,
  `deathplace` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `altbirthtype` varchar(5) COLLATE utf8mb4_unicode_ci NOT NULL,
  `altbirthdate` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `altbirthdatetr` date NOT NULL,
  `altbirthplace` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `burialdate` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `burialdatetr` date NOT NULL,
  `burialplace` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `burialtype` tinyint NOT NULL,
  `baptdate` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `baptdatetr` date NOT NULL,
  `baptplace` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `confdate` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `confdatetr` date NOT NULL,
  `confplace` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `initdate` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `initdatetr` date NOT NULL,
  `initplace` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `endldate` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `endldatetr` date NOT NULL,
  `endlplace` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `changedate` datetime NOT NULL,
  `nickname` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `title` tinytext COLLATE utf8mb4_unicode_ci NOT NULL,
  `prefix` tinytext COLLATE utf8mb4_unicode_ci NOT NULL,
  `suffix` tinytext COLLATE utf8mb4_unicode_ci NOT NULL,
  `nameorder` tinyint NOT NULL,
  `famc` varchar(22) COLLATE utf8mb4_unicode_ci NOT NULL,
  `metaphone` varchar(15) COLLATE utf8mb4_unicode_ci NOT NULL,
  `living` tinyint NOT NULL,
  `private` tinyint NOT NULL,
  `branch` varchar(512) COLLATE utf8mb4_unicode_ci NOT NULL,
  `changedby` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `edituser` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `edittime` int NOT NULL,
  PRIMARY KEY (`ID`),
  UNIQUE KEY `gedpers` (`gedcom`,`personID`),
  KEY `lastname` (`lastname`,`firstname`),
  KEY `firstname` (`firstname`),
  KEY `gedlast` (`gedcom`,`lastname`,`firstname`),
  KEY `gedfirst` (`gedcom`,`firstname`),
  KEY `birthplace` (`birthplace`(20)),
  KEY `altbirthplace` (`altbirthplace`(20)),
  KEY `deathplace` (`deathplace`(20)),
  KEY `burialplace` (`burialplace`(20)),
  KEY `baptplace` (`baptplace`(20)),
  KEY `confplace` (`confplace`(20)),
  KEY `initplace` (`initplace`(20)),
  KEY `endlplace` (`endlplace`(20)),
  KEY `changedate` (`changedate`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;
