mirror of
https://github.com/friendica/friendica
synced 2024-10-06 02:53:56 +02:00
Add key-value table
This commit is contained in:
parent
c264278c5d
commit
9a10bb4295
13
database.sql
13
database.sql
|
@ -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
|
||||
--
|
||||
|
|
|
@ -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 |
|
||||
|
|
24
doc/database/db_key-value.md
Normal file
24
doc/database/db_key-value.md
Normal 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)
|
|
@ -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" => [
|
||||
|
|
Loading…
Reference in a new issue