From ab42fd88a4c05f6e76bc836c42b751d9c6d22dbd Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 5 May 2022 08:45:32 +0000 Subject: [PATCH] Changed index for the categories --- database.sql | 4 ++-- doc/database/db_post-category.md | 10 +++++----- static/dbstructure.config.php | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/database.sql b/database.sql index 93f9bbef7e..f0d5854623 100644 --- a/database.sql +++ b/database.sql @@ -1071,8 +1071,8 @@ CREATE TABLE IF NOT EXISTS `post-category` ( `type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '', `tid` int unsigned NOT NULL DEFAULT 0 COMMENT '', PRIMARY KEY(`uri-id`,`uid`,`type`,`tid`), - INDEX `uri-id` (`tid`), - INDEX `uid` (`uid`), + INDEX `tid` (`tid`), + 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, FOREIGN KEY (`tid`) REFERENCES `tag` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT diff --git a/doc/database/db_post-category.md b/doc/database/db_post-category.md index b825a8f4b1..f28e306f17 100644 --- a/doc/database/db_post-category.md +++ b/doc/database/db_post-category.md @@ -16,11 +16,11 @@ Fields Indexes ------------ -| Name | Fields | -| ------- | ---------------------- | -| PRIMARY | uri-id, uid, type, tid | -| uri-id | tid | -| uid | uid | +| Name | Fields | +| ---------- | ---------------------- | +| PRIMARY | uri-id, uid, type, tid | +| tid | tid | +| uid_uri-id | uid, uri-id | Foreign Keys ------------ diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index 6d28b29141..df0d469fce 100644 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -1114,8 +1114,8 @@ return [ ], "indexes" => [ "PRIMARY" => ["uri-id", "uid", "type", "tid"], - "uri-id" => ["tid"], - "uid" => ["uid"], + "tid" => ["tid"], + "uid_uri-id" => ["uid", "uri-id"], ] ], "post-collection" => [