From 2255a5d41a39a1ffefe79406c2584fcf646189e5 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 19 Nov 2020 23:21:31 +0000 Subject: [PATCH 1/7] Foreign key for verb --- database.sql | 1 + static/dbstructure.config.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/database.sql b/database.sql index ea6a1fabe0..da3c458ef9 100644 --- a/database.sql +++ b/database.sql @@ -753,6 +753,7 @@ CREATE TABLE IF NOT EXISTS `item` ( FOREIGN KEY (`owner-id`) REFERENCES `contact` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT, FOREIGN KEY (`author-id`) REFERENCES `contact` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT, FOREIGN KEY (`causer-id`) REFERENCES `contact` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT, + FOREIGN KEY (`vid`) REFERENCES `verb` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT, FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE, FOREIGN KEY (`contact-id`) REFERENCES `contact` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE, FOREIGN KEY (`psid`) REFERENCES `permissionset` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index 08991ccbd8..4d729960fa 100644 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -726,7 +726,7 @@ return [ "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the author of this item"], "causer-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the contact that caused the item creation"], "icid" => ["type" => "int unsigned", "relation" => ["item-content" => "id"], "comment" => "Id of the item-content table entry that contains the whole item content"], - "vid" => ["type" => "smallint unsigned", "relation" => ["verb" => "id"], "comment" => "Id of the verb table entry that contains the activity verbs"], + "vid" => ["type" => "smallint unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"], "extid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"], "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], From b2e7a9cc5cfba5a0d82ed96aa7d0b578a52b7bb1 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 19 Nov 2020 23:28:10 +0000 Subject: [PATCH 2/7] Trying "int" --- database.sql | 4 ++-- static/dbstructure.config.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/database.sql b/database.sql index da3c458ef9..771174719c 100644 --- a/database.sql +++ b/database.sql @@ -661,7 +661,7 @@ CREATE TABLE IF NOT EXISTS `item` ( `author-id` int unsigned NOT NULL DEFAULT 0 COMMENT 'Link to the contact table with uid=0 of the author of this item', `causer-id` int unsigned NOT NULL DEFAULT 0 COMMENT 'Link to the contact table with uid=0 of the contact that caused the item creation', `icid` int unsigned COMMENT 'Id of the item-content table entry that contains the whole item content', - `vid` smallint unsigned COMMENT 'Id of the verb table entry that contains the activity verbs', + `vid` int unsigned COMMENT 'Id of the verb table entry that contains the activity verbs', `extid` varchar(255) NOT NULL DEFAULT '' COMMENT '', `post-type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'Post type (personal note, bookmark, ...)', `global` boolean NOT NULL DEFAULT '0' COMMENT '', @@ -1430,7 +1430,7 @@ CREATE TABLE IF NOT EXISTS `user-item` ( -- TABLE verb -- CREATE TABLE IF NOT EXISTS `verb` ( - `id` smallint unsigned NOT NULL auto_increment, + `id` int unsigned NOT NULL auto_increment, `name` varchar(100) NOT NULL DEFAULT '' COMMENT '', PRIMARY KEY(`id`) ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Activity Verbs'; diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index 4d729960fa..feef8cf0d8 100644 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -726,7 +726,7 @@ return [ "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the author of this item"], "causer-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the contact that caused the item creation"], "icid" => ["type" => "int unsigned", "relation" => ["item-content" => "id"], "comment" => "Id of the item-content table entry that contains the whole item content"], - "vid" => ["type" => "smallint unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"], + "vid" => ["type" => "int unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"], "extid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"], "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], @@ -1472,7 +1472,7 @@ return [ "verb" => [ "comment" => "Activity Verbs", "fields" => [ - "id" => ["type" => "smallint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"], + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"], "name" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""] ], "indexes" => [ From cd4a2bce9ca2c575f274e36aef0d9290cb831adf Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 19 Nov 2020 23:39:18 +0000 Subject: [PATCH 3/7] Trying "tinyint" --- database.sql | 4 ++-- static/dbstructure.config.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/database.sql b/database.sql index 771174719c..9f805c7b5b 100644 --- a/database.sql +++ b/database.sql @@ -661,7 +661,7 @@ CREATE TABLE IF NOT EXISTS `item` ( `author-id` int unsigned NOT NULL DEFAULT 0 COMMENT 'Link to the contact table with uid=0 of the author of this item', `causer-id` int unsigned NOT NULL DEFAULT 0 COMMENT 'Link to the contact table with uid=0 of the contact that caused the item creation', `icid` int unsigned COMMENT 'Id of the item-content table entry that contains the whole item content', - `vid` int unsigned COMMENT 'Id of the verb table entry that contains the activity verbs', + `vid` tinyint unsigned COMMENT 'Id of the verb table entry that contains the activity verbs', `extid` varchar(255) NOT NULL DEFAULT '' COMMENT '', `post-type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'Post type (personal note, bookmark, ...)', `global` boolean NOT NULL DEFAULT '0' COMMENT '', @@ -1430,7 +1430,7 @@ CREATE TABLE IF NOT EXISTS `user-item` ( -- TABLE verb -- CREATE TABLE IF NOT EXISTS `verb` ( - `id` int unsigned NOT NULL auto_increment, + `id` tinyint unsigned NOT NULL auto_increment, `name` varchar(100) NOT NULL DEFAULT '' COMMENT '', PRIMARY KEY(`id`) ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Activity Verbs'; diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index feef8cf0d8..569e2ac09b 100644 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -726,7 +726,7 @@ return [ "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the author of this item"], "causer-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the contact that caused the item creation"], "icid" => ["type" => "int unsigned", "relation" => ["item-content" => "id"], "comment" => "Id of the item-content table entry that contains the whole item content"], - "vid" => ["type" => "int unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"], + "vid" => ["type" => "tinyint unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"], "extid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"], "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], @@ -1472,7 +1472,7 @@ return [ "verb" => [ "comment" => "Activity Verbs", "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"], + "id" => ["type" => "tinyint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"], "name" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""] ], "indexes" => [ From d5cc4666039d3f4b4d43a4b94a21cec593d53074 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 19 Nov 2020 23:52:07 +0000 Subject: [PATCH 4/7] Mediumint --- database.sql | 4 ++-- static/dbstructure.config.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/database.sql b/database.sql index 9f805c7b5b..36e43d7afa 100644 --- a/database.sql +++ b/database.sql @@ -661,7 +661,7 @@ CREATE TABLE IF NOT EXISTS `item` ( `author-id` int unsigned NOT NULL DEFAULT 0 COMMENT 'Link to the contact table with uid=0 of the author of this item', `causer-id` int unsigned NOT NULL DEFAULT 0 COMMENT 'Link to the contact table with uid=0 of the contact that caused the item creation', `icid` int unsigned COMMENT 'Id of the item-content table entry that contains the whole item content', - `vid` tinyint unsigned COMMENT 'Id of the verb table entry that contains the activity verbs', + `vid` mediumint unsigned COMMENT 'Id of the verb table entry that contains the activity verbs', `extid` varchar(255) NOT NULL DEFAULT '' COMMENT '', `post-type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'Post type (personal note, bookmark, ...)', `global` boolean NOT NULL DEFAULT '0' COMMENT '', @@ -1430,7 +1430,7 @@ CREATE TABLE IF NOT EXISTS `user-item` ( -- TABLE verb -- CREATE TABLE IF NOT EXISTS `verb` ( - `id` tinyint unsigned NOT NULL auto_increment, + `id` mediumint unsigned NOT NULL auto_increment, `name` varchar(100) NOT NULL DEFAULT '' COMMENT '', PRIMARY KEY(`id`) ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Activity Verbs'; diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index 569e2ac09b..5e57d250f3 100644 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -726,7 +726,7 @@ return [ "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the author of this item"], "causer-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the contact that caused the item creation"], "icid" => ["type" => "int unsigned", "relation" => ["item-content" => "id"], "comment" => "Id of the item-content table entry that contains the whole item content"], - "vid" => ["type" => "tinyint unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"], + "vid" => ["type" => "mediumint unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"], "extid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"], "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], @@ -1472,7 +1472,7 @@ return [ "verb" => [ "comment" => "Activity Verbs", "fields" => [ - "id" => ["type" => "tinyint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"], + "id" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"], "name" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""] ], "indexes" => [ From e673da536c7839c3c18d341189ec217420f6ec29 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 20 Nov 2020 00:02:00 +0000 Subject: [PATCH 5/7] tinyint --- database.sql | 4 ++-- static/dbstructure.config.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/database.sql b/database.sql index 36e43d7afa..9f805c7b5b 100644 --- a/database.sql +++ b/database.sql @@ -661,7 +661,7 @@ CREATE TABLE IF NOT EXISTS `item` ( `author-id` int unsigned NOT NULL DEFAULT 0 COMMENT 'Link to the contact table with uid=0 of the author of this item', `causer-id` int unsigned NOT NULL DEFAULT 0 COMMENT 'Link to the contact table with uid=0 of the contact that caused the item creation', `icid` int unsigned COMMENT 'Id of the item-content table entry that contains the whole item content', - `vid` mediumint unsigned COMMENT 'Id of the verb table entry that contains the activity verbs', + `vid` tinyint unsigned COMMENT 'Id of the verb table entry that contains the activity verbs', `extid` varchar(255) NOT NULL DEFAULT '' COMMENT '', `post-type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'Post type (personal note, bookmark, ...)', `global` boolean NOT NULL DEFAULT '0' COMMENT '', @@ -1430,7 +1430,7 @@ CREATE TABLE IF NOT EXISTS `user-item` ( -- TABLE verb -- CREATE TABLE IF NOT EXISTS `verb` ( - `id` mediumint unsigned NOT NULL auto_increment, + `id` tinyint unsigned NOT NULL auto_increment, `name` varchar(100) NOT NULL DEFAULT '' COMMENT '', PRIMARY KEY(`id`) ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Activity Verbs'; diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index 5e57d250f3..569e2ac09b 100644 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -726,7 +726,7 @@ return [ "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the author of this item"], "causer-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the contact that caused the item creation"], "icid" => ["type" => "int unsigned", "relation" => ["item-content" => "id"], "comment" => "Id of the item-content table entry that contains the whole item content"], - "vid" => ["type" => "mediumint unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"], + "vid" => ["type" => "tinyint unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"], "extid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"], "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], @@ -1472,7 +1472,7 @@ return [ "verb" => [ "comment" => "Activity Verbs", "fields" => [ - "id" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"], + "id" => ["type" => "tinyint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"], "name" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""] ], "indexes" => [ From adc49724dd9c92d3819930a70eaffe6ce395126b Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 20 Nov 2020 00:05:25 +0000 Subject: [PATCH 6/7] Use "int" --- database.sql | 4 ++-- static/dbstructure.config.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/database.sql b/database.sql index 9f805c7b5b..771174719c 100644 --- a/database.sql +++ b/database.sql @@ -661,7 +661,7 @@ CREATE TABLE IF NOT EXISTS `item` ( `author-id` int unsigned NOT NULL DEFAULT 0 COMMENT 'Link to the contact table with uid=0 of the author of this item', `causer-id` int unsigned NOT NULL DEFAULT 0 COMMENT 'Link to the contact table with uid=0 of the contact that caused the item creation', `icid` int unsigned COMMENT 'Id of the item-content table entry that contains the whole item content', - `vid` tinyint unsigned COMMENT 'Id of the verb table entry that contains the activity verbs', + `vid` int unsigned COMMENT 'Id of the verb table entry that contains the activity verbs', `extid` varchar(255) NOT NULL DEFAULT '' COMMENT '', `post-type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'Post type (personal note, bookmark, ...)', `global` boolean NOT NULL DEFAULT '0' COMMENT '', @@ -1430,7 +1430,7 @@ CREATE TABLE IF NOT EXISTS `user-item` ( -- TABLE verb -- CREATE TABLE IF NOT EXISTS `verb` ( - `id` tinyint unsigned NOT NULL auto_increment, + `id` int unsigned NOT NULL auto_increment, `name` varchar(100) NOT NULL DEFAULT '' COMMENT '', PRIMARY KEY(`id`) ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Activity Verbs'; diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index 569e2ac09b..feef8cf0d8 100644 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -726,7 +726,7 @@ return [ "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the author of this item"], "causer-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the contact that caused the item creation"], "icid" => ["type" => "int unsigned", "relation" => ["item-content" => "id"], "comment" => "Id of the item-content table entry that contains the whole item content"], - "vid" => ["type" => "tinyint unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"], + "vid" => ["type" => "int unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"], "extid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"], "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], @@ -1472,7 +1472,7 @@ return [ "verb" => [ "comment" => "Activity Verbs", "fields" => [ - "id" => ["type" => "tinyint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"], + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"], "name" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""] ], "indexes" => [ From 190e0ff913bfafc8e28498ee4dcb30ffacdcdabf Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 20 Nov 2020 00:17:32 +0000 Subject: [PATCH 7/7] Moved table --- database.sql | 20 ++++++++++---------- static/dbstructure.config.php | 22 +++++++++++----------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/database.sql b/database.sql index 771174719c..0c9f367faf 100644 --- a/database.sql +++ b/database.sql @@ -248,6 +248,15 @@ CREATE TABLE IF NOT EXISTS `permissionset` ( FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE ) DEFAULT COLLATE utf8mb4_general_ci COMMENT=''; +-- +-- TABLE verb +-- +CREATE TABLE IF NOT EXISTS `verb` ( + `id` smallint unsigned NOT NULL auto_increment, + `name` varchar(100) NOT NULL DEFAULT '' COMMENT '', + PRIMARY KEY(`id`) +) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Activity Verbs'; + -- -- TABLE 2fa_app_specific_password -- @@ -661,7 +670,7 @@ CREATE TABLE IF NOT EXISTS `item` ( `author-id` int unsigned NOT NULL DEFAULT 0 COMMENT 'Link to the contact table with uid=0 of the author of this item', `causer-id` int unsigned NOT NULL DEFAULT 0 COMMENT 'Link to the contact table with uid=0 of the contact that caused the item creation', `icid` int unsigned COMMENT 'Id of the item-content table entry that contains the whole item content', - `vid` int unsigned COMMENT 'Id of the verb table entry that contains the activity verbs', + `vid` smallint unsigned COMMENT 'Id of the verb table entry that contains the activity verbs', `extid` varchar(255) NOT NULL DEFAULT '' COMMENT '', `post-type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'Post type (personal note, bookmark, ...)', `global` boolean NOT NULL DEFAULT '0' COMMENT '', @@ -1426,15 +1435,6 @@ CREATE TABLE IF NOT EXISTS `user-item` ( FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='User specific item data'; --- --- TABLE verb --- -CREATE TABLE IF NOT EXISTS `verb` ( - `id` int unsigned NOT NULL auto_increment, - `name` varchar(100) NOT NULL DEFAULT '' COMMENT '', - PRIMARY KEY(`id`) -) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Activity Verbs'; - -- -- TABLE worker-ipc -- diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index feef8cf0d8..3524fcab20 100644 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -307,6 +307,16 @@ return [ "uid_allow_cid_allow_gid_deny_cid_deny_gid" => ["uid", "allow_cid(50)", "allow_gid(30)", "deny_cid(50)", "deny_gid(30)"], ] ], + "verb" => [ + "comment" => "Activity Verbs", + "fields" => [ + "id" => ["type" => "smallint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"], + "name" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""] + ], + "indexes" => [ + "PRIMARY" => ["id"] + ] + ], // Main tables "2fa_app_specific_password" => [ "comment" => "Two-factor app-specific _password", @@ -726,7 +736,7 @@ return [ "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the author of this item"], "causer-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the contact that caused the item creation"], "icid" => ["type" => "int unsigned", "relation" => ["item-content" => "id"], "comment" => "Id of the item-content table entry that contains the whole item content"], - "vid" => ["type" => "int unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"], + "vid" => ["type" => "smallint unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"], "extid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"], "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], @@ -1469,16 +1479,6 @@ return [ "iid_uid" => ["iid", "uid"] ] ], - "verb" => [ - "comment" => "Activity Verbs", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"], - "name" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""] - ], - "indexes" => [ - "PRIMARY" => ["id"] - ] - ], "worker-ipc" => [ "comment" => "Inter process communication between the frontend and the worker", "fields" => [