]> git.mxchange.org Git - friendica.git/commitdiff
Unneeded legacy DFRN table removed
authorMichael <heluecht@pirati.ca>
Thu, 22 Jul 2021 07:11:26 +0000 (07:11 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 22 Jul 2021 07:11:26 +0000 (07:11 +0000)
database.sql
doc/database.md
doc/database/db_profile_check.md [deleted file]
src/Database/DBStructure.php
src/Worker/OptimizeTables.php
static/dbstructure.config.php
update.php

index 3b9cceb069a02ba9668af7c595a1aab56c384620..8ae1b913b51139ea83cef46becab69f1ef2eb14d 100644 (file)
@@ -1349,23 +1349,6 @@ CREATE TABLE IF NOT EXISTS `profile` (
        FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
 ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='user profiles data';
 
---
--- TABLE profile_check
---
-CREATE TABLE IF NOT EXISTS `profile_check` (
-       `id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
-       `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
-       `cid` int unsigned NOT NULL DEFAULT 0 COMMENT 'contact.id',
-       `dfrn_id` varchar(255) NOT NULL DEFAULT '' COMMENT '',
-       `sec` varchar(255) NOT NULL DEFAULT '' COMMENT '',
-       `expire` int unsigned NOT NULL DEFAULT 0 COMMENT '',
-        PRIMARY KEY(`id`),
-        INDEX `uid` (`uid`),
-        INDEX `cid` (`cid`),
-       FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE,
-       FOREIGN KEY (`cid`) REFERENCES `contact` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
-) DEFAULT COLLATE utf8mb4_general_ci COMMENT='DFRN remote auth use';
-
 --
 -- TABLE profile_field
 --
index b1274ed327ab7dfc9ade474abc4690205ea666d2..194f30eb6eac0dc57512c79368bbab17a92f0654 100644 (file)
@@ -59,7 +59,6 @@ Database Tables
 | [post-user-notification](help/database/db_post-user-notification) | User post notifications |
 | [process](help/database/db_process) | Currently running system processes |
 | [profile](help/database/db_profile) | user profiles data |
-| [profile_check](help/database/db_profile_check) | DFRN remote auth use |
 | [profile_field](help/database/db_profile_field) | Custom profile fields |
 | [push_subscriber](help/database/db_push_subscriber) | Used for OStatus: Contains feed subscribers |
 | [register](help/database/db_register) | registrations requiring admin approval |
diff --git a/doc/database/db_profile_check.md b/doc/database/db_profile_check.md
deleted file mode 100644 (file)
index 4049bd6..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-Table profile_check
-===========
-
-DFRN remote auth use
-
-Fields
-------
-
-| Field   | Description   | Type               | Null | Key | Default | Extra          |
-| ------- | ------------- | ------------------ | ---- | --- | ------- | -------------- |
-| id      | sequential ID | int unsigned       | NO   | PRI | NULL    | auto_increment |
-| uid     | User id       | mediumint unsigned | NO   |     | 0       |                |
-| cid     | contact.id    | int unsigned       | NO   |     | 0       |                |
-| dfrn_id |               | varchar(255)       | NO   |     |         |                |
-| sec     |               | varchar(255)       | NO   |     |         |                |
-| expire  |               | int unsigned       | NO   |     | 0       |                |
-
-Indexes
-------------
-
-| Name    | Fields |
-| ------- | ------ |
-| PRIMARY | id     |
-| uid     | uid    |
-| cid     | cid    |
-
-Foreign Keys
-------------
-
-| Field | Target Table | Target Field |
-|-------|--------------|--------------|
-| uid | [user](help/database/db_user) | uid |
-| cid | [contact](help/database/db_contact) | id |
-
-Return to [database documentation](help/database)
index c002c277c23fb31840c86ecaa561b2114d40044c..d7f1179d023d3fd03c52daff6098f6a58d5f13ab 100644 (file)
@@ -82,7 +82,7 @@ class DBStructure
                $old_tables = ['fserver', 'gcign', 'gcontact', 'gcontact-relation', 'gfollower' ,'glink', 'item-delivery-data',
                        'item-activity', 'item-content', 'item_id', 'participation', 'poll', 'poll_result', 'queue', 'retriever_rule',
                        'deliverq', 'dsprphotoq', 'ffinder', 'sign', 'spam', 'term', 'user-item', 'thread', 'item', 'challenge',
-                       'auth_codes', 'clients', 'tokens'];
+                       'auth_codes', 'clients', 'tokens', 'profile_check'];
 
                $tables = DBA::selectToArray(['INFORMATION_SCHEMA' => 'TABLES'], ['TABLE_NAME'],
                        ['TABLE_SCHEMA' => DBA::databaseName(), 'TABLE_TYPE' => 'BASE TABLE']);
index 41c5b4a756e51c5266eebd26864cab509e77ffe4..954b89702b23e8f59684b8d524d48bbd8d121d23 100644 (file)
@@ -44,7 +44,6 @@ class OptimizeTables
                DBA::e("OPTIMIZE TABLE `locks`");
                DBA::e("OPTIMIZE TABLE `oembed`");
                DBA::e("OPTIMIZE TABLE `parsed_url`");
-               DBA::e("OPTIMIZE TABLE `profile_check`");
                DBA::e("OPTIMIZE TABLE `session`");
 
                Logger::info('Optimize end');
index 24ae1bb05cc247b967807c6f2745bfee272fe13e..ded539af509e655a02269e36fe5938020660ce3e 100644 (file)
@@ -1368,22 +1368,6 @@ return [
                        "pub_keywords" => ["FULLTEXT", "pub_keywords"],
                ]
        ],
-       "profile_check" => [
-               "comment" => "DFRN remote auth use",
-               "fields" => [
-                       "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
-                       "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
-                       "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact.id"],
-                       "dfrn_id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                       "sec" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                       "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
-               ],
-               "indexes" => [
-                       "PRIMARY" => ["id"],
-                       "uid" => ["uid"],
-                       "cid" => ["cid"],
-               ]
-       ],
        "profile_field" => [
                "comment" => "Custom profile fields",
                "fields" => [
index 84f895838b5ac6af2b94dcd02bcb02ada7192be7..842fefca88f9f4bea7d24dd8e1bedfa71a40fccc 100644 (file)
@@ -446,7 +446,7 @@ function pre_update_1364()
                return Update::FAILED;
        }
 
-       if (!DBA::e("DELETE FROM `profile_check` WHERE NOT `uid` IN (SELECT `uid` FROM `user`)")) {
+       if (DBStructure::existsTable('profile_check') && !DBA::e("DELETE FROM `profile_check` WHERE NOT `uid` IN (SELECT `uid` FROM `user`)")) {
                return Update::FAILED;
        }
 
@@ -498,7 +498,7 @@ function pre_update_1364()
                return Update::FAILED;
        }
 
-       if (!DBA::e("DELETE FROM `profile_check` WHERE NOT `cid` IN (SELECT `id` FROM `contact`)")) {
+       if (DBStructure::existsTable('profile_check') && !DBA::e("DELETE FROM `profile_check` WHERE NOT `cid` IN (SELECT `id` FROM `contact`)")) {
                return Update::FAILED;
        }