From 2a4b5b4cb46b6e08047210f60aa1bacd6446d2e8 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 5 May 2022 08:40:50 +0000 Subject: [PATCH] New index --- database.sql | 1 + doc/database/db_post-media.md | 1 + static/dbstructure.config.php | 1 + 3 files changed, 3 insertions(+) diff --git a/database.sql b/database.sql index 5aa9a5b706..93f9bbef7e 100644 --- a/database.sql +++ b/database.sql @@ -1191,6 +1191,7 @@ CREATE TABLE IF NOT EXISTS `post-media` ( `publisher-image` varbinary(255) COMMENT 'Image of the publisher of the media', PRIMARY KEY(`id`), UNIQUE INDEX `uri-id-url` (`uri-id`,`url`), + INDEX `uri-id-id` (`uri-id`,`id`), FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Attached media'; diff --git a/doc/database/db_post-media.md b/doc/database/db_post-media.md index e17a04e5fb..5c2a1bfd97 100644 --- a/doc/database/db_post-media.md +++ b/doc/database/db_post-media.md @@ -35,6 +35,7 @@ Indexes | ---------- | ------------------- | | PRIMARY | id | | uri-id-url | UNIQUE, uri-id, url | +| uri-id-id | uri-id, id | Foreign Keys ------------ diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index e3435989cf..6d28b29141 100644 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -1230,6 +1230,7 @@ return [ "indexes" => [ "PRIMARY" => ["id"], "uri-id-url" => ["UNIQUE", "uri-id", "url"], + "uri-id-id" => ["uri-id", "id"], ] ], "post-question" => [