From 6857d24995b0844a0cec89588fe874399f631a71 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Thu, 7 Nov 2019 22:09:19 -0500 Subject: [PATCH] [Database] Structure version 1331 - Add profile_field table --- database.sql | 21 ++++++++++++++++++++- static/dbstructure.config.php | 21 ++++++++++++++++++++- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/database.sql b/database.sql index 8db6c1d6f0..2b93174546 100644 --- a/database.sql +++ b/database.sql @@ -1,6 +1,6 @@ -- ------------------------------------------ -- Friendica 2020.03-dev (Dalmatian Bellflower) --- DB_UPDATE_VERSION 1330 +-- DB_UPDATE_VERSION 1331 -- ------------------------------------------ @@ -1053,6 +1053,25 @@ CREATE TABLE IF NOT EXISTS `profile_check` ( PRIMARY KEY(`id`) ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='DFRN remote auth use'; +-- +-- TABLE profile_field +-- +CREATE TABLE IF NOT EXISTS `profile_field` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'sequential ID', + `uid` mediumint(8) unsigned NOT NULL DEFAULT 0 COMMENT 'Owner user id', + `psid` int(10) unsigned DEFAULT NULL COMMENT 'ID of the permission set of this profile field - 0 = public', + `name` varchar(255) NOT NULL DEFAULT '' COMMENT 'Name of the field', + `value` text COMMENT 'Value of the field', + `order` mediumint(8) unsigned NOT NULL DEFAULT 1 COMMENT 'Field ordering per user', + `label` varchar(255) NOT NULL DEFAULT '' COMMENT 'Label of the field', + `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '', + `edited` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '', + PRIMARY KEY (`id`), + KEY `uid` (`uid`), + KEY `psid` (`psid`), + KEY `order` (`order`) +) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Custom profile fields'; + -- -- TABLE push_subscriber -- diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index 49934c63cf..6ad1d24178 100755 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -34,7 +34,7 @@ use Friendica\Database\DBA; if (!defined('DB_UPDATE_VERSION')) { - define('DB_UPDATE_VERSION', 1330); + define('DB_UPDATE_VERSION', 1331); } return [ @@ -1145,6 +1145,25 @@ return [ "PRIMARY" => ["id"], ] ], + "profile_field" => [ + "comment" => "Custom profile fields", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"], + "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner user id"], + "order" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "1", "comment" => "Field ordering per user"], + "psid" => ["type" => "int unsigned", "relation" => ["permissionset" => "id"], "comment" => "ID of the permission set of this profile field - 0 = public"], + "label" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Label of the field"], + "value" => ["type" => "text", "comment" => "Value of the field"], + "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"], + "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"], + ], + "indexes" => [ + "PRIMARY" => ["id"], + "uid" => ["uid"], + "order" => ["order"], + "psid" => ["psid"], + ] + ], "push_subscriber" => [ "comment" => "Used for OStatus: Contains feed subscribers", "fields" => [