From 5f6943b0085c64ce753954b6ede587bbfbd98be6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Sun, 19 Jun 2022 10:48:47 +0200 Subject: [PATCH] Changes: - MySQL index on BLOB/TEXT can only be partial (e.g.: `column`(length)) --- database.sql | 2 +- doc/database/db_post-media.md | 10 +++++----- static/dbstructure.config.php | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/database.sql b/database.sql index 76b6423520..8f0e41cecf 100644 --- a/database.sql +++ b/database.sql @@ -1234,7 +1234,7 @@ CREATE TABLE IF NOT EXISTS `post-media` ( `publisher-name` varchar(255) COMMENT 'Name of the publisher of the media', `publisher-image` varbinary(255) COMMENT 'Image of the publisher of the media', PRIMARY KEY(`id`), - UNIQUE INDEX `uri-id-url` (`uri-id`,`url`), + UNIQUE INDEX `uri-id-url` (`uri-id`,`url`(512)), 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 d6d9a06552..0563f5ee89 100644 --- a/doc/database/db_post-media.md +++ b/doc/database/db_post-media.md @@ -31,11 +31,11 @@ Fields Indexes ------------ -| Name | Fields | -| ---------- | ------------------- | -| PRIMARY | id | -| uri-id-url | UNIQUE, uri-id, url | -| uri-id-id | uri-id, id | +| Name | Fields | +| ---------- | ------------------------ | +| PRIMARY | id | +| uri-id-url | UNIQUE, uri-id, url(512) | +| uri-id-id | uri-id, id | Foreign Keys ------------ diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index e4cfe2535d..fe7f50f17c 100644 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -1272,7 +1272,7 @@ return [ ], "indexes" => [ "PRIMARY" => ["id"], - "uri-id-url" => ["UNIQUE", "uri-id", "url"], + "uri-id-url" => ["UNIQUE", "uri-id", "url(512)"], "uri-id-id" => ["uri-id", "id"], ] ],