diff --git a/database.sql b/database.sql index 843db1f6cf..b6ee05e84e 100644 --- a/database.sql +++ b/database.sql @@ -495,6 +495,16 @@ CREATE TABLE IF NOT EXISTS `cache` ( INDEX `k_expires` (`k`,`expires`) ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Stores temporary data'; +-- +-- TABLE config +-- +CREATE TABLE IF NOT EXISTS `config` ( + `cat` varbinary(50) NOT NULL DEFAULT '' COMMENT 'The category of the entry', + `k` varbinary(50) NOT NULL DEFAULT '' COMMENT 'The key of the entry', + `v` mediumtext COMMENT '', + PRIMARY KEY(`cat`,`k`) +) DEFAULT COLLATE utf8mb4_general_ci COMMENT='main configuration storage'; + -- -- TABLE contact-relation -- diff --git a/doc/database.md b/doc/database.md index 95e0367afe..edfb7b8226 100644 --- a/doc/database.md +++ b/doc/database.md @@ -18,6 +18,7 @@ Database Tables | [arrived-activity](help/database/db_arrived-activity) | Id of arrived activities | | [attach](help/database/db_attach) | file attachments | | [cache](help/database/db_cache) | Stores temporary data | +| [config](help/database/db_config) | main configuration storage | | [contact](help/database/db_contact) | contact table | | [contact-relation](help/database/db_contact-relation) | Contact relations | | [conv](help/database/db_conv) | private messages | diff --git a/src/Database/DBStructure.php b/src/Database/DBStructure.php index 579b9cdc11..dc1e785a50 100644 --- a/src/Database/DBStructure.php +++ b/src/Database/DBStructure.php @@ -74,7 +74,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', 'tokens', 'clients', 'profile_check', 'host', 'conversation', 'fcontact', 'config', 'addon']; + 'auth_codes', 'tokens', 'clients', 'profile_check', 'host', 'conversation', 'fcontact', 'addon']; $tables = DBA::selectToArray('INFORMATION_SCHEMA.TABLES', ['TABLE_NAME'], ['TABLE_SCHEMA' => DBA::databaseName(), 'TABLE_TYPE' => 'BASE TABLE']); diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index 9dfd7820c1..3eeacb705d 100644 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -554,6 +554,17 @@ return [ "k_expires" => ["k", "expires"], ] ], + "config" => [ + "comment" => "main configuration storage", + "fields" => [ + "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => "The category of the entry"], + "k" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => "The key of the entry"], + "v" => ["type" => "mediumtext", "comment" => ""], + ], + "indexes" => [ + "PRIMARY" => ["cat", "k"], + ] + ], "contact-relation" => [ "comment" => "Contact relations", "fields" => [