Merge pull request #10536 from annando/dfrn2

Unneeded legacy DFRN table removed
This commit is contained in:
Hypolite Petovan 2021-07-22 07:44:15 -04:00 committed by GitHub
commit 2eb0349582
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 3 additions and 73 deletions

View File

@ -1349,23 +1349,6 @@ CREATE TABLE IF NOT EXISTS `profile` (
FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='user profiles data'; ) 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 -- TABLE profile_field
-- --

View File

@ -59,7 +59,6 @@ Database Tables
| [post-user-notification](help/database/db_post-user-notification) | User post notifications | | [post-user-notification](help/database/db_post-user-notification) | User post notifications |
| [process](help/database/db_process) | Currently running system processes | | [process](help/database/db_process) | Currently running system processes |
| [profile](help/database/db_profile) | user profiles data | | [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 | | [profile_field](help/database/db_profile_field) | Custom profile fields |
| [push_subscriber](help/database/db_push_subscriber) | Used for OStatus: Contains feed subscribers | | [push_subscriber](help/database/db_push_subscriber) | Used for OStatus: Contains feed subscribers |
| [register](help/database/db_register) | registrations requiring admin approval | | [register](help/database/db_register) | registrations requiring admin approval |

View File

@ -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)

View File

@ -82,7 +82,7 @@ class DBStructure
$old_tables = ['fserver', 'gcign', 'gcontact', 'gcontact-relation', 'gfollower' ,'glink', 'item-delivery-data', $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', 'item-activity', 'item-content', 'item_id', 'participation', 'poll', 'poll_result', 'queue', 'retriever_rule',
'deliverq', 'dsprphotoq', 'ffinder', 'sign', 'spam', 'term', 'user-item', 'thread', 'item', 'challenge', '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'], $tables = DBA::selectToArray(['INFORMATION_SCHEMA' => 'TABLES'], ['TABLE_NAME'],
['TABLE_SCHEMA' => DBA::databaseName(), 'TABLE_TYPE' => 'BASE TABLE']); ['TABLE_SCHEMA' => DBA::databaseName(), 'TABLE_TYPE' => 'BASE TABLE']);

View File

@ -44,7 +44,6 @@ class OptimizeTables
DBA::e("OPTIMIZE TABLE `locks`"); DBA::e("OPTIMIZE TABLE `locks`");
DBA::e("OPTIMIZE TABLE `oembed`"); DBA::e("OPTIMIZE TABLE `oembed`");
DBA::e("OPTIMIZE TABLE `parsed_url`"); DBA::e("OPTIMIZE TABLE `parsed_url`");
DBA::e("OPTIMIZE TABLE `profile_check`");
DBA::e("OPTIMIZE TABLE `session`"); DBA::e("OPTIMIZE TABLE `session`");
Logger::info('Optimize end'); Logger::info('Optimize end');

View File

@ -1368,22 +1368,6 @@ return [
"pub_keywords" => ["FULLTEXT", "pub_keywords"], "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" => [ "profile_field" => [
"comment" => "Custom profile fields", "comment" => "Custom profile fields",
"fields" => [ "fields" => [

View File

@ -446,7 +446,7 @@ function pre_update_1364()
return Update::FAILED; 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; return Update::FAILED;
} }
@ -498,7 +498,7 @@ function pre_update_1364()
return Update::FAILED; 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; return Update::FAILED;
} }