[Database 1528] Add expected index for foreign key user-gserver.gsid

This commit is contained in:
Hypolite Petovan 2023-08-21 08:07:10 -04:00
parent e9861b11f3
commit 76cc8eaff8
3 changed files with 5 additions and 2 deletions

View File

@ -1,6 +1,6 @@
-- ------------------------------------------ -- ------------------------------------------
-- Friendica 2023.09-dev (Giant Rhubarb) -- Friendica 2023.09-dev (Giant Rhubarb)
-- DB_UPDATE_VERSION 1527 -- DB_UPDATE_VERSION 1528
-- ------------------------------------------ -- ------------------------------------------
@ -109,6 +109,7 @@ CREATE TABLE IF NOT EXISTS `user-gserver` (
`gsid` int unsigned NOT NULL DEFAULT 0 COMMENT 'Gserver id', `gsid` int unsigned NOT NULL DEFAULT 0 COMMENT 'Gserver id',
`ignored` boolean NOT NULL DEFAULT '0' COMMENT 'server accounts are ignored for the user', `ignored` boolean NOT NULL DEFAULT '0' COMMENT 'server accounts are ignored for the user',
PRIMARY KEY(`uid`,`gsid`), PRIMARY KEY(`uid`,`gsid`),
INDEX `gsid` (`gsid`),
FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE, FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE,
FOREIGN KEY (`gsid`) REFERENCES `gserver` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE FOREIGN KEY (`gsid`) REFERENCES `gserver` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='User settings about remote servers'; ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='User settings about remote servers';

View File

@ -18,6 +18,7 @@ Indexes
| Name | Fields | | Name | Fields |
| ------- | --------- | | ------- | --------- |
| PRIMARY | uid, gsid | | PRIMARY | uid, gsid |
| gsid | gsid |
Foreign Keys Foreign Keys
------------ ------------

View File

@ -56,7 +56,7 @@ use Friendica\Database\DBA;
// This file is required several times during the test in DbaDefinition which justifies this condition // This file is required several times during the test in DbaDefinition which justifies this condition
if (!defined('DB_UPDATE_VERSION')) { if (!defined('DB_UPDATE_VERSION')) {
define('DB_UPDATE_VERSION', 1527); define('DB_UPDATE_VERSION', 1528);
} }
return [ return [
@ -168,6 +168,7 @@ return [
], ],
"indexes" => [ "indexes" => [
"PRIMARY" => ["uid", "gsid"], "PRIMARY" => ["uid", "gsid"],
"gsid" => ["gsid"]
], ],
], ],
"item-uri" => [ "item-uri" => [