Skip to content

Commit

Permalink
Update master/shard SQL schemas according to db-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
piernov committed Nov 17, 2022
1 parent 0c55f4b commit 27f43b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
9 changes: 5 additions & 4 deletions misc/master.sql
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ CREATE TABLE `keyPermissions` (
`libraryID` int(10) unsigned NOT NULL,
`permission` enum('library','notes','write') NOT NULL,
`granted` tinyint(1) unsigned NOT NULL,
PRIMARY KEY (`keyID`,`libraryID`,`permission`)
PRIMARY KEY (`keyID`,`libraryID`,`permission`),
KEY `libraryID` (`libraryID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


Expand All @@ -181,11 +182,11 @@ CREATE TABLE `keys` (
CREATE TABLE `libraries` (
`libraryID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`libraryType` enum('user','group','publications') NOT NULL,
`lastUpdated` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`version` int(10) unsigned NOT NULL DEFAULT '0',
`hasData` TINYINT(1) NOT NULL DEFAULT '0',
`shardID` smallint(5) unsigned NOT NULL,
PRIMARY KEY (`libraryID`),
KEY `shardID` (`shardID`)
KEY `shardID` (`shardID`),
KEY `hasData` (`hasData`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


Expand Down
5 changes: 3 additions & 2 deletions misc/shard.sql
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ CREATE TABLE `items` (
PRIMARY KEY (`itemID`),
UNIQUE KEY `key` (`libraryID`,`key`),
KEY `itemTypeID` (`itemTypeID`),
KEY `serverDateModified` (`serverDateModified`)
KEY `serverDateModified` (`serverDateModified`),
KEY `libraryVersion` (`libraryID`, `version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


Expand Down Expand Up @@ -286,7 +287,7 @@ CREATE TABLE `savedSearches` (

CREATE TABLE `settings` (
`libraryID` int(10) unsigned NOT NULL,
`name` varchar(35) NOT NULL,
`name` varchar(35) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`value` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`version` int(10) unsigned NOT NULL,
`lastUpdated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
Expand Down

0 comments on commit 27f43b5

Please sign in to comment.