]> git.mxchange.org Git - friendica.git/blobdiff - static/dbstructure.config.php
Use gsid for the network name
[friendica.git] / static / dbstructure.config.php
index 8203ae520217623f5f6930668dcd54de4dcc84fa..03748f36a50c8903f2bd9b302b7a16b9ef1c7fe6 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -55,7 +55,7 @@
 use Friendica\Database\DBA;
 
 if (!defined('DB_UPDATE_VERSION')) {
-       define('DB_UPDATE_VERSION', 1437);
+       define('DB_UPDATE_VERSION', 1461);
 }
 
 return [
@@ -71,6 +71,11 @@ return [
                        "info" => ["type" => "text", "comment" => ""],
                        "register_policy" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
                        "registered-users" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Number of registered users"],
+                       "active-week-users" => ["type" => "int unsigned", "comment" => "Number of active users in the last week"],
+                       "active-month-users" => ["type" => "int unsigned", "comment" => "Number of active users in the last month"],
+                       "active-halfyear-users" => ["type" => "int unsigned", "comment" => "Number of active users in the last six month"],
+                       "local-posts" => ["type" => "int unsigned", "comment" => "Number of local posts"],
+                       "local-comments" => ["type" => "int unsigned", "comment" => "Number of local comments"],
                        "directory-type" => ["type" => "tinyint", "default" => "0", "comment" => "Type of directory service (Poco, Mastodon)"],
                        "poco" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                        "noscrape" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
@@ -284,7 +289,8 @@ return [
                "fields" => [
                        "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
                        "name" => ["type" => "varchar(96)", "not null" => "1", "default" => "", "comment" => ""],
-                       "url" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""]
+                       "url" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
+                       "type" => ["type" => "tinyint unsigned", "comment" => "Type of the tag (Unknown, General Collection, Follower Collection or Account)"],
                ],
                "indexes" => [
                        "PRIMARY" => ["id"],
@@ -389,6 +395,8 @@ return [
                        "inbox" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
                        "outbox" => ["type" => "varchar(255)", "comment" => ""],
                        "sharedinbox" => ["type" => "varchar(255)", "comment" => ""],
+                       "featured" => ["type" => "varchar(255)", "comment" => "Address for the collection of featured posts"],
+                       "featured-tags" => ["type" => "varchar(255)", "comment" => "Address for the collection of featured tags"],
                        "manually-approve" => ["type" => "boolean", "comment" => ""],
                        "discoverable" => ["type" => "boolean", "comment" => "Mastodon extension: true if profile is published in their directory"],
                        "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
@@ -610,6 +618,18 @@ return [
                        "PRIMARY" => ["uri-id"]
                ]
        ],
+       "endpoint" => [
+               "comment" => "ActivityPub endpoints - used in the ActivityPub implementation",
+               "fields" => [
+                       "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URL of the contact"],
+                       "type" => ["type" => "varchar(20)", "not null" => "1", "comment" => ""],
+                       "owner-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the apcontact url"],
+               ],
+               "indexes" => [
+                       "PRIMARY" => ["url"],
+                       "owner-uri-id_type" => ["UNIQUE", "owner-uri-id", "type"],
+               ]
+       ],
        "event" => [
                "comment" => "Events",
                "fields" => [
@@ -662,6 +682,9 @@ return [
                        "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                        "pubkey" => ["type" => "text", "comment" => ""],
                        "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
+                       "interacting_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of contacts this contact interactes with"],
+                       "interacted_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of contacts that interacted with this contact"],
+                       "post_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of posts and comments"],
                ],
                "indexes" => [
                        "PRIMARY" => ["id"],
@@ -696,11 +719,13 @@ return [
                        "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
                        "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the member list is not private"],
                        "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the group has been deleted"],
+                       "cid" => ["type" => "int unsigned", "foreign" => ["contact" => "id"], "comment" => "Contact id of forum. When this field is filled then the members are synced automatically."],
                        "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "human readable name of group"],
                ],
                "indexes" => [
                        "PRIMARY" => ["id"],
                        "uid" => ["uid"],
+                       "cid" => ["cid"],
                ]
        ],
        "group_member" => [
@@ -743,17 +768,6 @@ return [
                        "hook_file_function" => ["UNIQUE", "hook", "file", "function"],
                ]
        ],
-       "host" => [
-               "comment" => "Hostname",
-               "fields" => [
-                       "id" => ["type" => "tinyint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
-                       "name" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => "The hostname"],
-               ],
-               "indexes" => [
-                       "PRIMARY" => ["id"],
-                       "name" => ["UNIQUE", "name"],
-               ]
-       ],
        "inbox-status" => [
                "comment" => "Status of ActivityPub inboxes",
                "fields" => [
@@ -774,19 +788,21 @@ return [
                "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", "foreign" => ["user" => "uid"], "comment" => "User id"],
-                       "fid" => ["type" => "int unsigned", "relation" => ["fcontact" => "id"], "comment" => ""],
+                       "fid" => ["type" => "int unsigned", "relation" => ["fcontact" => "id"], "comment" => "deprecated"],
                        "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => ""],
+                       "suggest-cid" => ["type" => "int unsigned", "foreign" => ["contact" => "id"], "comment" => "Suggested contact"],
                        "knowyou" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
-                       "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+                       "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "deprecated"],
                        "note" => ["type" => "text", "comment" => ""],
                        "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                        "datetime" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
-                       "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
+                       "blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "deprecated"],
                        "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
                ],
                "indexes" => [
                        "PRIMARY" => ["id"],
                        "contact-id" => ["contact-id"],
+                       "suggest-cid" => ["suggest-cid"],
                        "uid" => ["uid"],
                ]
        ],
@@ -889,7 +905,8 @@ return [
                        "target-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the related post"],
                        "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related post"],
                        "created" => ["type" => "datetime", "comment" => ""],
-                       "seen" => ["type" => "boolean", "default" => "0", "comment" => ""],
+                       "seen" => ["type" => "boolean", "default" => "0", "comment" => "Seen on the desktop"],
+                       "dismissed" => ["type" => "boolean", "default" => "0", "comment" => "Dismissed via the API"],
                ],
                "indexes" => [
                        "PRIMARY" => ["id"],
@@ -902,7 +919,7 @@ return [
                ]
        ],
        "notify" => [
-               "comment" => "notifications",
+               "comment" => "[Deprecated] User notifications",
                "fields" => [
                        "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
                        "type" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
@@ -1023,6 +1040,7 @@ return [
                        "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                        "desc" => ["type" => "text", "comment" => ""],
                        "album" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "The name of the album to which the photo belongs"],
+                       "photo-type" => ["type" => "tinyint unsigned", "comment" => "User avatar, user banner, contact avatar, contact banner or default"],
                        "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                        "type" => ["type" => "varchar(30)", "not null" => "1", "default" => "image/jpeg"],
                        "height" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
@@ -1048,6 +1066,7 @@ return [
                        "uid_album_scale_created" => ["uid", "album(32)", "scale", "created"],
                        "uid_album_resource-id_created" => ["uid", "album(32)", "resource-id", "created"],
                        "resource-id" => ["resource-id"],
+                       "uid_photo-type" => ["uid", "photo-type"],
                ]
        ],
        "post" => [
@@ -1097,6 +1116,17 @@ return [
                        "uid" => ["uid"],
                ]
        ],
+       "post-collection" => [
+               "comment" => "Collection of posts",
+               "fields" => [
+                       "uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
+                       "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "0 - Featured"],
+               ],
+               "indexes" => [
+                       "PRIMARY" => ["uri-id", "type"],
+                       "type" => ["type"],
+               ]
+       ],
        "post-content" => [
                "comment" => "Content for all posts",
                "fields" => [
@@ -1185,6 +1215,32 @@ return [
                        "uri-id-url" => ["UNIQUE", "uri-id", "url"],
                ]
        ],
+       "post-question" => [
+               "comment" => "Question",
+               "fields" => [
+                       "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
+                       "uri-id" => ["type" => "int unsigned", "not null" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
+                       "multiple" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Multiple choice"],
+                       "voters" => ["type" => "int unsigned", "comment" => "Number of voters for this question"],
+                       "end-time" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Question end time"],
+               ],
+               "indexes" => [
+                       "PRIMARY" => ["id"],
+                       "uri-id" => ["UNIQUE", "uri-id"],
+               ]
+       ],
+       "post-question-option" => [
+               "comment" => "Question option",
+               "fields" => [
+                       "id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "comment" => "Id of the question"],
+                       "uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
+                       "name" => ["type" => "varchar(255)", "comment" => "Name of the option"],
+                       "replies" => ["type" => "int unsigned", "comment" => "Number of replies for this question option"],
+               ],
+               "indexes" => [
+                       "PRIMARY" => ["uri-id", "id"],
+               ]
+       ],
        "post-tag" => [
                "comment" => "post relation to tags",
                "fields" => [
@@ -1291,13 +1347,13 @@ return [
                        "changed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date that something in the conversation changed, indicating clients should fetch the conversation again"],
                        "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
                        "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
-                       "pinned" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "The thread is pinned on the profile page"],
+                       "pinned" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "deprecated"],
                        "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
                        "ignored" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Ignore updates for this thread"],
                        "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "This item was posted to the wall of uid"],
                        "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
                        "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
-                       "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
+                       "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Deprecated"],
                        "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact.id"],
                        "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "post has not been seen"],
                        "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide the post from the user"],
@@ -1318,7 +1374,6 @@ return [
                        "commented" => ["commented"],
                        "uid_received" => ["uid", "received"],
                        "uid_wall_received" => ["uid", "wall", "received"],
-                       "uid_pinned" => ["uid", "pinned"],
                        "uid_commented" => ["uid", "commented"],
                        "uid_starred" => ["uid", "starred"],
                        "uid_mention" => ["uid", "mention"],
@@ -1339,12 +1394,13 @@ return [
        "process" => [
                "comment" => "Currently running system processes",
                "fields" => [
-                       "pid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "comment" => ""],
+                       "pid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "comment" => "The ID of the process"],
+                       "hostname" => ["type" => "varchar(32)", "not null" => "1", "primary" => "1", "comment" => "The name of the host the process is ran on"],
                        "command" => ["type" => "varbinary(32)", "not null" => "1", "default" => "", "comment" => ""],
                        "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
                ],
                "indexes" => [
-                       "PRIMARY" => ["pid"],
+                       "PRIMARY" => ["pid", "hostname"],
                        "command" => ["command"],
                ]
        ],
@@ -1536,6 +1592,8 @@ return [
                        "blocked" => ["type" => "boolean", "comment" => "Contact is completely blocked for this user"],
                        "ignored" => ["type" => "boolean", "comment" => "Posts from this contact are ignored"],
                        "collapsed" => ["type" => "boolean", "comment" => "Posts from this contact are collapsed"],
+                       "hidden" => ["type" => "boolean", "comment" => "This contact is hidden from the others"],
+                       "is-blocked" => ["type" => "boolean", "comment" => "User is blocked by this contact"],
                        "pending" => ["type" => "boolean", "comment" => ""],
                        "rel" => ["type" => "tinyint unsigned", "comment" => "The kind of the relation between the user and the contact"],
                        "info" => ["type" => "mediumtext", "comment" => ""],