]> git.mxchange.org Git - friendica.git/blobdiff - static/dbstructure.config.php
Merge pull request #9016 from annando/network-view
[friendica.git] / static / dbstructure.config.php
index dd1528a2f59e860bb2a0c4d891a310c74e8a84c0..aa1552f9c0018b374963561c547f326e3ad724f8 100755 (executable)
 use Friendica\Database\DBA;
 
 if (!defined('DB_UPDATE_VERSION')) {
-       define('DB_UPDATE_VERSION', 1348);
+       define('DB_UPDATE_VERSION', 1360);
 }
 
 return [
        // Side tables
+       "gserver" => [
+               "comment" => "Global servers",
+               "fields" => [
+                       "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
+                       "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+                       "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+                       "version" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+                       "site_name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+                       "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"],
+                       "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" => ""],
+                       "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
+                       "platform" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+                       "relay-subscribe" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Has the server subscribed to the relay system"],
+                       "relay-scope" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => "The scope of messages that the server wants to get"],
+                       "detection-method" => ["type" => "tinyint unsigned", "comment" => "Method that had been used to detect that server"],
+                       "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
+                       "last_poco_query" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
+                       "last_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
+                       "last_failure" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
+                       "failed" => ["type" => "boolean", "comment" => "Connection failed"],
+               ],
+               "indexes" => [
+                       "PRIMARY" => ["id"],
+                       "nurl" => ["UNIQUE", "nurl(190)"],
+               ]
+       ],
        "clients" => [
                "comment" => "OAuth usage",
                "fields" => [
@@ -112,6 +142,7 @@ return [
                        "notify" => ["type" => "varchar(255)", "comment" => ""],
                        "poll" => ["type" => "varchar(255)", "comment" => ""],
                        "confirm" => ["type" => "varchar(255)", "comment" => ""],
+                       "subscribe" => ["type" => "varchar(255)", "comment" => ""],
                        "poco" => ["type" => "varchar(255)", "comment" => ""],
                        "aes_allow" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
                        "ret-aes" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
@@ -121,11 +152,13 @@ return [
                        "last-update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last try to update the contact info"],
                        "success_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful contact update"],
                        "failure_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed update"],
+                       "failed" => ["type" => "boolean", "comment" => "Connection failed"],
                        "name-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
                        "uri-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
                        "avatar-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
                        "term-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
                        "last-item" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "date of the last post"],
+                       "last-discovery" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "date of the last follower discovery"],
                        "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
                        "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "Node-wide block status"],
                        "block_reason" => ["type" => "text", "comment" => "Node-wide block reason"],
@@ -142,6 +175,7 @@ return [
                        "unsearchable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact prefers to not be searchable"],
                        "sensitive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact posts sensitive content"],
                        "baseurl" => ["type" => "varchar(255)", "default" => "", "comment" => "baseurl of the contact"],
+                       "gsid" => ["type" => "int unsigned", "foreign" => ["gserver" => "id", "on delete" => "restrict"], "comment" => "Global Server ID"],
                        "reason" => ["type" => "text", "comment" => ""],
                        "closeness" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "99", "comment" => ""],
                        "info" => ["type" => "mediumtext", "comment" => ""],
@@ -150,7 +184,7 @@ return [
                        "bd" => ["type" => "date", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""],
                        "notify_new_posts" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
                        "fetch_further_information" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
-                       "ffi_keyword_blacklist" => ["type" => "text", "comment" => ""],
+                       "ffi_keyword_denylist" => ["type" => "text", "comment" => ""],
                ],
                "indexes" => [
                        "PRIMARY" => ["id"],
@@ -164,8 +198,12 @@ return [
                        "addr_uid" => ["addr(32)", "uid"],
                        "nurl_uid" => ["nurl(32)", "uid"],
                        "nick_uid" => ["nick(32)", "uid"],
+                       "attag_uid" => ["attag(32)", "uid"],
                        "dfrn-id" => ["dfrn-id(64)"],
                        "issued-id" => ["issued-id(64)"],
+                       "network_uid_lastupdate" => ["network", "uid", "last-update"],
+                       "uid_lastitem" => ["uid", "last-item"],                 
+                       "gsid" => ["gsid"]
                ]
        ],
        "item-uri" => [
@@ -272,7 +310,9 @@ return [
                        "addr" => ["type" => "varchar(255)", "comment" => ""],
                        "alias" => ["type" => "varchar(255)", "comment" => ""],
                        "pubkey" => ["type" => "text", "comment" => ""],
+                       "subscribe" => ["type" => "varchar(255)", "comment" => ""],
                        "baseurl" => ["type" => "varchar(255)", "comment" => "baseurl of the ap contact"],
+                       "gsid" => ["type" => "int unsigned", "foreign" => ["gserver" => "id", "on delete" => "restrict"], "comment" => "Global Server ID"],
                        "generator" => ["type" => "varchar(255)", "comment" => "Name of the contact's system"],
                        "following_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of following contacts"],
                        "followers_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of followers"],
@@ -283,7 +323,9 @@ return [
                        "PRIMARY" => ["url"],
                        "addr" => ["addr(32)"],
                        "alias" => ["alias(190)"],
-                       "url" => ["followers(190)"]
+                       "followers" => ["followers(190)"],
+                       "baseurl" => ["baseurl(190)"],
+                       "gsid" => ["gsid"]
                ]
        ],
        "attach" => [
@@ -367,9 +409,11 @@ return [
        "contact-relation" => [
                "comment" => "Contact relations",
                "fields" => [
-                       "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "primary" => "1", "comment" => "contact the related contact had interacted with"],
-                       "relation-cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "primary" => "1", "comment" => "related contact who had interacted with the contact"],
+                       "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "primary" => "1", "comment" => "contact the related contact had interacted with"],
+                       "relation-cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "primary" => "1", "comment" => "related contact who had interacted with the contact"],
                        "last-interaction" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last interaction"],
+                       "follow-updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last update of the contact relationship"],
+                       "follows" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
                ],
                "indexes" => [
                        "PRIMARY" => ["cid", "relation-cid"],
@@ -494,90 +538,6 @@ return [
                        "PRIMARY" => ["id"],
                ]
        ],
-       "gcign" => [
-               "comment" => "contacts ignored by friend suggestions",
-               "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" => "Local User id"],
-                       "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => "gcontact.id of ignored contact"],
-               ],
-               "indexes" => [
-                       "PRIMARY" => ["id"],
-                       "uid" => ["uid"],
-                       "gcid" => ["gcid"],
-               ]
-       ],
-       "gcontact" => [
-               "comment" => "global contacts",
-               "fields" => [
-                       "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
-                       "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"],
-                       "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"],
-                       "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the contacts profile page"],
-                       "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                       "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the profile photo"],
-                       "connect" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                       "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
-                       "updated" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
-                       "last_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
-                       "last_failure" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
-                       "last_discovery" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last contact discovery"],
-                       "archive_date" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
-                       "archived" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
-                       "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                       "about" => ["type" => "text", "comment" => ""],
-                       "keywords" => ["type" => "text", "comment" => "puplic keywords (interests)"],
-                       "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Deprecated"],
-                       "birthday" => ["type" => "varchar(32)", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""],
-                       "community" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if contact is forum account"],
-                       "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "-1", "comment" => ""],
-                       "hide" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = should be hidden from search"],
-                       "nsfw" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = contact posts nsfw content"],
-                       "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "social network protocol"],
-                       "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                       "notify" => ["type" => "varchar(255)", "comment" => ""],
-                       "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                       "generation" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
-                       "server_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "baseurl of the contacts server"],
-               ],
-               "indexes" => [
-                       "PRIMARY" => ["id"],
-                       "nurl" => ["UNIQUE", "nurl(190)"],
-                       "name" => ["name(64)"],
-                       "nick" => ["nick(32)"],
-                       "addr" => ["addr(64)"],
-                       "hide_network_updated" => ["hide", "network", "updated"],
-                       "updated" => ["updated"],
-               ]
-       ],
-       "gfollower" => [
-               "comment" => "Followers of global contacts",
-               "fields" => [
-                       "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["gcontact" => "id"], "comment" => "global contact"],
-                       "follower-gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["gcontact" => "id"], "comment" => "global contact of the follower"],
-                       "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates that the connection has been deleted"],
-               ],
-               "indexes" => [
-                       "PRIMARY" => ["gcid", "follower-gcid"],
-                       "follower-gcid" => ["follower-gcid"],
-               ]
-       ],
-       "glink" => [
-               "comment" => "'friends of friends' linkages derived from poco",
-               "fields" => [
-                       "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
-                       "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
-                       "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
-                       "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
-                       "zcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
-                       "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
-               ],
-               "indexes" => [
-                       "PRIMARY" => ["id"],
-                       "cid_uid_gcid_zcid" => ["UNIQUE", "cid", "uid", "gcid", "zcid"],
-                       "gcid" => ["gcid"],
-               ]
-       ],
        "group" => [
                "comment" => "privacy groups, group info",
                "fields" => [
@@ -605,34 +565,6 @@ return [
                        "gid_contactid" => ["UNIQUE", "gid", "contact-id"],
                ]
        ],
-       "gserver" => [
-               "comment" => "Global servers",
-               "fields" => [
-                       "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
-                       "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                       "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                       "version" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                       "site_name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                       "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"],
-                       "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" => ""],
-                       "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
-                       "platform" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                       "relay-subscribe" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Has the server subscribed to the relay system"],
-                       "relay-scope" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => "The scope of messages that the server wants to get"],
-                       "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
-                       "last_poco_query" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
-                       "last_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
-                       "last_failure" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
-               ],
-               "indexes" => [
-                       "PRIMARY" => ["id"],
-                       "nurl" => ["UNIQUE", "nurl(190)"],
-               ]
-       ],
        "gserver-tag" => [
                "comment" => "Tags that the server has subscribed",
                "fields" => [
@@ -1336,6 +1268,7 @@ return [
                "fields" => [
                        "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"],
                                "comment" => "sequential ID"],
+                       "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
                        "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
                        "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
                        "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item owner"],
@@ -1374,6 +1307,7 @@ return [
                        "uid_commented" => ["uid", "commented"],
                        "uid_wall_received" => ["uid", "wall", "received"],
                        "private_wall_origin_commented" => ["private", "wall", "origin", "commented"],
+                       "uri-id" => ["uri-id"],
                ]
        ],
        "tokens" => [