Merge pull request #12830 from MrPetovan/bug/12828-addon-table

Remove addon table from DB structure
This commit is contained in:
Philipp 2023-02-21 21:06:18 +01:00 committed by GitHub
commit f4af683af2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 4 additions and 67 deletions

View file

@ -340,22 +340,6 @@ CREATE TABLE IF NOT EXISTS `account-user` (
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='Remote and local accounts'; ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Remote and local accounts';
--
-- TABLE addon
--
CREATE TABLE IF NOT EXISTS `addon` (
`id` int unsigned NOT NULL auto_increment COMMENT '',
`name` varchar(50) NOT NULL DEFAULT '' COMMENT 'addon base (file)name',
`version` varchar(50) NOT NULL DEFAULT '' COMMENT 'currently unused',
`installed` boolean NOT NULL DEFAULT '0' COMMENT 'currently always 1',
`hidden` boolean NOT NULL DEFAULT '0' COMMENT 'currently unused',
`timestamp` int unsigned NOT NULL DEFAULT 0 COMMENT 'file timestamp to check for reloads',
`plugin_admin` boolean NOT NULL DEFAULT '0' COMMENT '1 = has admin config, 0 = has no admin config',
PRIMARY KEY(`id`),
INDEX `installed_name` (`installed`,`name`),
UNIQUE INDEX `name` (`name`)
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='registered addons';
-- --
-- TABLE apcontact -- TABLE apcontact
-- --

View file

@ -10,7 +10,6 @@ Database Tables
| [2fa_trusted_browser](help/database/db_2fa_trusted_browser) | Two-factor authentication trusted browsers | | [2fa_trusted_browser](help/database/db_2fa_trusted_browser) | Two-factor authentication trusted browsers |
| [account-suggestion](help/database/db_account-suggestion) | Account suggestion | | [account-suggestion](help/database/db_account-suggestion) | Account suggestion |
| [account-user](help/database/db_account-user) | Remote and local accounts | | [account-user](help/database/db_account-user) | Remote and local accounts |
| [addon](help/database/db_addon) | registered addons |
| [apcontact](help/database/db_apcontact) | ActivityPub compatible contacts - used in the ActivityPub implementation | | [apcontact](help/database/db_apcontact) | ActivityPub compatible contacts - used in the ActivityPub implementation |
| [application](help/database/db_application) | OAuth application | | [application](help/database/db_application) | OAuth application |
| [application-marker](help/database/db_application-marker) | Timeline marker | | [application-marker](help/database/db_application-marker) | Timeline marker |

View file

@ -1,29 +0,0 @@
Table addon
===========
registered addons
Fields
------
| Field | Description | Type | Null | Key | Default | Extra |
| ------------ | --------------------------------------------- | ------------ | ---- | --- | ------- | -------------- |
| id | | int unsigned | NO | PRI | NULL | auto_increment |
| name | addon base (file)name | varchar(50) | NO | | | |
| version | currently unused | varchar(50) | NO | | | |
| installed | currently always 1 | boolean | NO | | 0 | |
| hidden | currently unused | boolean | NO | | 0 | |
| timestamp | file timestamp to check for reloads | int unsigned | NO | | 0 | |
| plugin_admin | 1 = has admin config, 0 = has no admin config | boolean | NO | | 0 | |
Indexes
------------
| Name | Fields |
| -------------- | --------------- |
| PRIMARY | id |
| installed_name | installed, name |
| name | UNIQUE, name |
Return to [database documentation](help/database)

View file

@ -399,23 +399,6 @@ return [
"uid_uri-id" => ["uid", "uri-id"], "uid_uri-id" => ["uid", "uri-id"],
] ]
], ],
"addon" => [
"comment" => "registered addons",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"name" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "addon base (file)name"],
"version" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "currently unused"],
"installed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently always 1"],
"hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently unused"],
"timestamp" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "file timestamp to check for reloads"],
"plugin_admin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = has admin config, 0 = has no admin config"],
],
"indexes" => [
"PRIMARY" => ["id"],
"installed_name" => ["installed", "name"],
"name" => ["UNIQUE", "name"],
]
],
"apcontact" => [ "apcontact" => [
"comment" => "ActivityPub compatible contacts - used in the ActivityPub implementation", "comment" => "ActivityPub compatible contacts - used in the ActivityPub implementation",
"fields" => [ "fields" => [

View file

@ -24,6 +24,7 @@ namespace Friendica\Test\src\Module\Api;
use Friendica\App; use Friendica\App;
use Friendica\Capabilities\ICanCreateResponses; use Friendica\Capabilities\ICanCreateResponses;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\Hook; use Friendica\Core\Hook;
use Friendica\Database\Database; use Friendica\Database\Database;
use Friendica\DI; use Friendica\DI;
@ -212,15 +213,14 @@ abstract class ApiTest extends FixtureTest
$func(DI::app()); $func(DI::app());
} }
/** @var Database $dba */ /** @var $config IManageConfigValues */
$dba = $this->dice->create(Database::class); $config = $this->dice->create(IManageConfigValues::class);
$dba->insert('addon', [ $config->set('addons', $addon, [
'name' => $addon, 'name' => $addon,
'installed' => true, 'installed' => true,
'timestamp' => $t, 'timestamp' => $t,
'plugin_admin' => function_exists($addon . '_addon_admin'), 'plugin_admin' => function_exists($addon . '_addon_admin'),
'hidden' => file_exists('addon/' . $addon . '/.hidden')
]); ]);
Addon::loadAddons(); Addon::loadAddons();