DROP TABLE IF EXISTS tng_families;
CREATE TABLE `tng_families` (
  `ID` int NOT NULL AUTO_INCREMENT,
  `gedcom` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `familyID` varchar(22) COLLATE utf8mb4_unicode_ci NOT NULL,
  `husband` varchar(22) COLLATE utf8mb4_unicode_ci NOT NULL,
  `wife` varchar(22) COLLATE utf8mb4_unicode_ci NOT NULL,
  `marrdate` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `marrdatetr` date NOT NULL,
  `marrplace` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `marrtype` varchar(90) COLLATE utf8mb4_unicode_ci NOT NULL,
  `divdate` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `divdatetr` date NOT NULL,
  `divplace` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `sealdate` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `sealdatetr` date NOT NULL,
  `sealplace` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `husborder` tinyint NOT NULL,
  `wifeorder` tinyint NOT NULL,
  `changedate` datetime 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 `familyID` (`gedcom`,`familyID`),
  KEY `husband` (`gedcom`,`husband`),
  KEY `wife` (`gedcom`,`wife`),
  KEY `marrplace` (`marrplace`(20)),
  KEY `divplace` (`divplace`(20)),
  KEY `changedate` (`changedate`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;
