From e561cad844951d7711e92c96019698da70a47e02 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 2 Feb 2021 06:28:51 +0000 Subject: [PATCH] "participation" is removed since it is unused --- database.sql | 16 ---------------- doc/database.md | 1 - doc/database/db_particiation.md | 10 ---------- src/Database/DBStructure.php | 2 +- static/dbstructure.config.php | 14 -------------- update.php | 12 ------------ 6 files changed, 1 insertion(+), 54 deletions(-) delete mode 100644 doc/database/db_particiation.md diff --git a/database.sql b/database.sql index b717da446..60dca5f5f 100644 --- a/database.sql +++ b/database.sql @@ -970,22 +970,6 @@ CREATE TABLE IF NOT EXISTS `parsed_url` ( INDEX `created` (`created`) ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='cache for \'parse_url\' queries'; --- --- TABLE participation --- -CREATE TABLE IF NOT EXISTS `participation` ( - `iid` int unsigned NOT NULL COMMENT '', - `server` varchar(60) NOT NULL COMMENT '', - `cid` int unsigned NOT NULL COMMENT '', - `fid` int unsigned NOT NULL COMMENT '', - PRIMARY KEY(`iid`,`server`), - INDEX `cid` (`cid`), - INDEX `fid` (`fid`), - FOREIGN KEY (`iid`) REFERENCES `item` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE, - FOREIGN KEY (`cid`) REFERENCES `contact` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE, - FOREIGN KEY (`fid`) REFERENCES `fcontact` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Storage for participation messages from Diaspora'; - -- -- TABLE pconfig -- diff --git a/doc/database.md b/doc/database.md index e135b19ae..447607f8d 100644 --- a/doc/database.md +++ b/doc/database.md @@ -32,7 +32,6 @@ Database Tables | [notify-threads](help/database/db_notify-threads) | | | [oembed](help/database/db_oembed) | cache for OEmbed queries | | [parsed_url](help/database/db_parsed_url) | cache for "parse_url" queries | -| [participation](help/database/db_participation) | Storage for participation messages from Diaspora | | [pconfig](help/database/db_pconfig) | personal (per user) configuration storage | | [photo](help/database/db_photo) | photo storage | | [poll](help/database/db_poll) | data for polls | diff --git a/doc/database/db_particiation.md b/doc/database/db_particiation.md deleted file mode 100644 index 27f063241..000000000 --- a/doc/database/db_particiation.md +++ /dev/null @@ -1,10 +0,0 @@ -Table participation -=================== - -| Field | Description | Type | Null | Key | Default | Extra | -|-------------|------------------|------------------|------|-----|---------------------|-------| -| iid | item id | int(10) unsigned | NO | PRI | | | -| server | Name of server | varchar(60) | NO | PRI | | | -| cid | contact id | int(10) unsigned | NO | | | | - -Return to [database documentation](help/database) diff --git a/src/Database/DBStructure.php b/src/Database/DBStructure.php index 3e1ef7aa1..b9e53be04 100644 --- a/src/Database/DBStructure.php +++ b/src/Database/DBStructure.php @@ -79,7 +79,7 @@ class DBStructure } $old_tables = ['fserver', 'gcign', 'gcontact', 'gcontact-relation', 'gfollower' ,'glink', 'item-delivery-data', - 'item-activity', 'item-content', 'item_id', 'poll', 'poll_result', 'queue', 'retriever_rule', + 'item-activity', 'item-content', 'item_id', 'participation', 'poll', 'poll_result', 'queue', 'retriever_rule', 'sign', 'spam', 'term', 'user-item']; $tables = DBA::selectToArray(['INFORMATION_SCHEMA' => 'TABLES'], ['TABLE_NAME'], diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index d6e21512a..6b8aba3ac 100644 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -1031,20 +1031,6 @@ return [ "created" => ["created"], ] ], - "participation" => [ - "comment" => "Storage for participation messages from Diaspora", - "fields" => [ - "iid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["item" => "id"], "comment" => ""], - "server" => ["type" => "varchar(60)", "not null" => "1", "primary" => "1", "comment" => ""], - "cid" => ["type" => "int unsigned", "not null" => "1", "foreign" => ["contact" => "id"], "comment" => ""], - "fid" => ["type" => "int unsigned", "not null" => "1", "foreign" => ["fcontact" => "id"], "comment" => ""], - ], - "indexes" => [ - "PRIMARY" => ["iid", "server"], - "cid" => ["cid"], - "fid" => ["fid"] - ] - ], "pconfig" => [ "comment" => "personal (per user) configuration storage", "fields" => [ diff --git a/update.php b/update.php index d5bfc5fe3..94029065b 100644 --- a/update.php +++ b/update.php @@ -490,10 +490,6 @@ function pre_update_1364() return Update::FAILED; } - if (!DBA::e("DELETE FROM `participation` WHERE NOT `cid` IN (SELECT `id` FROM `contact`)")) { - return Update::FAILED; - } - if (!DBA::e("DELETE FROM `profile_check` WHERE NOT `cid` IN (SELECT `id` FROM `contact`)")) { return Update::FAILED; } @@ -502,10 +498,6 @@ function pre_update_1364() return Update::FAILED; } - if (!DBA::e("DELETE FROM `participation` WHERE NOT `fid` IN (SELECT `id` FROM `fcontact`)")) { - return Update::FAILED; - } - if (!DBA::e("DELETE FROM `group_member` WHERE NOT `gid` IN (SELECT `id` FROM `group`)")) { return Update::FAILED; } @@ -514,10 +506,6 @@ function pre_update_1364() return Update::FAILED; } - if (!DBA::e("DELETE FROM `participation` WHERE NOT `iid` IN (SELECT `id` FROM `item`)")) { - return Update::FAILED; - } - if (DBStructure::existsTable('user-item') && !DBA::e("DELETE FROM `user-item` WHERE NOT `iid` IN (SELECT `id` FROM `item`)")) { return Update::FAILED; }