+--
+-- TABLE account-suggestion
+--
+CREATE TABLE IF NOT EXISTS `account-suggestion` (
+ `uri-id` int unsigned NOT NULL COMMENT 'Id of the item-uri table entry that contains the account url',
+ `uid` mediumint unsigned NOT NULL COMMENT 'User ID',
+ `level` smallint unsigned COMMENT 'level of closeness',
+ `ignore` boolean NOT NULL DEFAULT '0' COMMENT 'If set, this account will not be suggested again',
+ PRIMARY KEY(`uid`,`uri-id`),
+ INDEX `uri-id_uid` (`uri-id`,`uid`),
+ FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
+ FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
+) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Account suggestion';
+
+--
+-- TABLE account-user
+--
+CREATE TABLE IF NOT EXISTS `account-user` (
+ `id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
+ `uri-id` int unsigned NOT NULL COMMENT 'Id of the item-uri table entry that contains the account url',
+ `uid` mediumint unsigned NOT NULL COMMENT 'User ID',
+ PRIMARY KEY(`id`),
+ UNIQUE INDEX `uri-id_uid` (`uri-id`,`uid`),
+ INDEX `uid_uri-id` (`uid`,`uri-id`),
+ FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
+ FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
+) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Remote and local accounts';
+