]> git.mxchange.org Git - friendica.git/commitdiff
[Database] Structure version 1331
authorHypolite Petovan <hypolite@mrpetovan.com>
Fri, 8 Nov 2019 03:09:19 +0000 (22:09 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Thu, 23 Jan 2020 00:42:33 +0000 (19:42 -0500)
- Add profile_field table

database.sql
static/dbstructure.config.php

index 8db6c1d6f02725d461550d0a12a960e80452e884..2b93174546902c50a4313054a25c755ea977fbfb 100644 (file)
@@ -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
 --
index 49934c63cf2324ea86d6e5d40b175e4f45e59cba..6ad1d241783d81a11d5eb31e48f5125e697ad845 100755 (executable)
@@ -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" => [