Add primary keys to LocSubjects and Tags tables

Missed these before, and in addition to being a good practice, they are needed to maintain insertion order of LocSubjects and Tags.
This commit is contained in:
Mike Colagrosso 2024-05-20 22:12:36 -06:00 committed by Alex Cabal
parent dc62553269
commit ac7db8d375
2 changed files with 4 additions and 0 deletions

View file

@ -1,5 +1,7 @@
CREATE TABLE `EbookLocSubjects` ( CREATE TABLE `EbookLocSubjects` (
`EbookLocSubjectId` int(10) unsigned NOT NULL AUTO_INCREMENT,
`EbookId` int(10) unsigned NOT NULL, `EbookId` int(10) unsigned NOT NULL,
`LocSubjectId` int(10) unsigned NOT NULL, `LocSubjectId` int(10) unsigned NOT NULL,
PRIMARY KEY (`EbookLocSubjectId`),
UNIQUE KEY `idxUnique` (`EbookId`,`LocSubjectId`) UNIQUE KEY `idxUnique` (`EbookId`,`LocSubjectId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

View file

@ -1,5 +1,7 @@
CREATE TABLE `EbookTags` ( CREATE TABLE `EbookTags` (
`EbookTagId` int(10) unsigned NOT NULL AUTO_INCREMENT,
`EbookId` int(10) unsigned NOT NULL, `EbookId` int(10) unsigned NOT NULL,
`TagId` int(10) unsigned NOT NULL, `TagId` int(10) unsigned NOT NULL,
PRIMARY KEY (`EbookTagId`),
UNIQUE KEY `idxUnique` (`EbookId`,`TagId`) UNIQUE KEY `idxUnique` (`EbookId`,`TagId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;