DROP TABLE IF EXISTS tng_medialinks;
CREATE TABLE `tng_medialinks` (
  `medialinkID` int NOT NULL AUTO_INCREMENT,
  `gedcom` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `linktype` char(1) COLLATE utf8mb4_unicode_ci NOT NULL,
  `personID` varchar(248) COLLATE utf8mb4_unicode_ci NOT NULL,
  `eventID` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  `mediaID` int NOT NULL,
  `altdescription` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `altnotes` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `ordernum` float NOT NULL,
  `dontshow` tinyint NOT NULL,
  `defphoto` varchar(1) COLLATE utf8mb4_unicode_ci NOT NULL,
  `cleft` smallint NOT NULL,
  `ctop` smallint NOT NULL,
  `cwidth` smallint NOT NULL,
  `cheight` smallint NOT NULL,
  PRIMARY KEY (`medialinkID`),
  UNIQUE KEY `mediaID` (`gedcom`,`personID`(22),`mediaID`,`eventID`),
  KEY `personID` (`gedcom`,`personID`(22),`ordernum`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC;
