Add key-value table

This commit is contained in:
Philipp 2022-12-29 16:54:08 +01:00
parent c264278c5d
commit 9a10bb4295
No known key found for this signature in database
GPG Key ID: 24A7501396EB5432
4 changed files with 50 additions and 2 deletions

View File

@ -1,6 +1,6 @@
-- ------------------------------------------
-- Friendica 2023.03-dev (Giant Rhubarb)
-- DB_UPDATE_VERSION 1504
-- DB_UPDATE_VERSION 1505
-- ------------------------------------------
@ -839,6 +839,17 @@ CREATE TABLE IF NOT EXISTS `intro` (
FOREIGN KEY (`suggest-cid`) REFERENCES `contact` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='';
--
-- TABLE key-value
--
CREATE TABLE IF NOT EXISTS `key-value` (
`id` int unsigned NOT NULL auto_increment COMMENT '',
`k` varbinary(50) NOT NULL DEFAULT '' COMMENT '',
`v` mediumtext COMMENT '',
PRIMARY KEY(`id`),
UNIQUE INDEX `k` (`k`)
) DEFAULT COLLATE utf8mb4_general_ci COMMENT='A key value storage';
--
-- TABLE locks
--

View File

@ -40,6 +40,7 @@ Database Tables
| [inbox-status](help/database/db_inbox-status) | Status of ActivityPub inboxes |
| [intro](help/database/db_intro) | |
| [item-uri](help/database/db_item-uri) | URI and GUID for items |
| [key-value](help/database/db_key-value) | A key value storage |
| [locks](help/database/db_locks) | |
| [mail](help/database/db_mail) | private messages |
| [mailacct](help/database/db_mailacct) | Mail account data for fetching mails |

View File

@ -0,0 +1,24 @@
Table key-value
===========
A key value storage
Fields
------
| Field | Description | Type | Null | Key | Default | Extra |
| ----- | ----------- | ------------- | ---- | --- | ------- | -------------- |
| id | | int unsigned | NO | PRI | NULL | auto_increment |
| k | | varbinary(50) | NO | | | |
| v | | mediumtext | YES | | NULL | |
Indexes
------------
| Name | Fields |
| ------- | --------- |
| PRIMARY | id |
| k | UNIQUE, k |
Return to [database documentation](help/database)

View File

@ -55,7 +55,7 @@
use Friendica\Database\DBA;
if (!defined('DB_UPDATE_VERSION')) {
define('DB_UPDATE_VERSION', 1504);
define('DB_UPDATE_VERSION', 1505);
}
return [
@ -889,6 +889,18 @@ return [
"uid" => ["uid"],
]
],
"key-value" => [
"comment" => "A key value storage",
"fields" => [
"id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
"k" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
"v" => ["type" => "mediumtext", "comment" => ""],
],
"indexes" => [
"PRIMARY" => ["id"],
"k" => ["UNIQUE", "k"],
],
],
"locks" => [
"comment" => "",
"fields" => [