]> git.mxchange.org Git - friendica.git/blobdiff - static/dbstructure.config.php
Use webfinger in apcontact fetch
[friendica.git] / static / dbstructure.config.php
index 512002f25cb5578f2de8075944d3499df0d1d646..ba244e9a2ffb796e71fcfb9422e12b4279f997a1 100755 (executable)
 use Friendica\Database\DBA;
 
 if (!defined('DB_UPDATE_VERSION')) {
-       define('DB_UPDATE_VERSION', 1349);
+       define('DB_UPDATE_VERSION', 1353);
 }
 
 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" => ""],
+               ],
+               "indexes" => [
+                       "PRIMARY" => ["id"],
+                       "nurl" => ["UNIQUE", "nurl(190)"],
+               ]
+       ],
        "clients" => [
                "comment" => "OAuth usage",
                "fields" => [
@@ -112,6 +141,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" => ""],
@@ -142,6 +172,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" => ""],
@@ -166,6 +197,7 @@ return [
                        "nick_uid" => ["nick(32)", "uid"],
                        "dfrn-id" => ["dfrn-id(64)"],
                        "issued-id" => ["issued-id(64)"],
+                       "gsid" => ["gsid"]
                ]
        ],
        "item-uri" => [
@@ -272,7 +304,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 +317,8 @@ return [
                        "PRIMARY" => ["url"],
                        "addr" => ["addr(32)"],
                        "alias" => ["alias(190)"],
-                       "url" => ["followers(190)"]
+                       "followers" => ["followers(190)"],
+                       "gsid" => ["gsid"]
                ]
        ],
        "attach" => [
@@ -539,6 +574,7 @@ return [
                        "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"],
+                       "gsid" => ["type" => "int unsigned", "foreign" => ["gserver" => "id", "on delete" => "restrict"], "comment" => "Global Server ID"],
                ],
                "indexes" => [
                        "PRIMARY" => ["id"],
@@ -548,6 +584,7 @@ return [
                        "addr" => ["addr(64)"],
                        "hide_network_updated" => ["hide", "network", "updated"],
                        "updated" => ["updated"],
+                       "gsid" => ["gsid"]
                ]
        ],
        "gfollower" => [
@@ -605,34 +642,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 +1345,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 +1384,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" => [