]> git.mxchange.org Git - friendica.git/blobdiff - static/dbstructure.config.php
Extract Storage admin section to own page
[friendica.git] / static / dbstructure.config.php
index e3b1bea30c6b4695261025de68d8c9e22de9cb36..ded539af509e655a02269e36fe5938020660ce3e 100644 (file)
@@ -55,7 +55,7 @@
 use Friendica\Database\DBA;
 
 if (!defined('DB_UPDATE_VERSION')) {
-       define('DB_UPDATE_VERSION', 1420);
+       define('DB_UPDATE_VERSION', 1430);
 }
 
 return [
@@ -152,6 +152,19 @@ return [
                        "email" => ["email(64)"],
                ]
        ],
+       "item-uri" => [
+               "comment" => "URI and GUID for items",
+               "fields" => [
+                       "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
+                       "uri" => ["type" => "varbinary(255)", "not null" => "1", "comment" => "URI of an item"],
+                       "guid" => ["type" => "varbinary(255)", "comment" => "A unique identifier for an item"]
+               ],
+               "indexes" => [
+                       "PRIMARY" => ["id"],
+                       "uri" => ["UNIQUE", "uri"],
+                       "guid" => ["guid"]
+               ]
+       ],
        "contact" => [
                "comment" => "contact table",
                "fields" => [
@@ -162,7 +175,7 @@ return [
                        "self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if the contact is the user him/her self"],
                        "remote_self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
                        "rel" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "The kind of the relation between the user and the contact"],
-                       "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
+                       "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Deprecated"],
                        "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network of the contact"],
                        "protocol" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Protocol of the contact"],
                        "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"],
@@ -177,11 +190,13 @@ return [
                        "photo" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo of the contact"],
                        "thumb" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (thumb size)"],
                        "micro" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (micro size)"],
-                       "site-pubkey" => ["type" => "text", "comment" => ""],
-                       "issued-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                       "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+                       "header" => ["type" => "varchar(255)", "comment" => "Header picture"],
+                       "site-pubkey" => ["type" => "text", "comment" => "Deprecated"],
+                       "issued-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Deprecated"],
+                       "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Deprecated"],
                        "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                        "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+                       "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the contact url"],
                        "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                        "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                        "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
@@ -193,8 +208,8 @@ return [
                        "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" => ""],
+                       "aes_allow" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Deprecated"],
+                       "ret-aes" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Deprecated"],
                        "usehub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
                        "subhub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
                        "hub-verify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
@@ -250,8 +265,6 @@ return [
                        "nurl_uid" => ["nurl(128)", "uid"],
                        "nick_uid" => ["nick(128)", "uid"],
                        "attag_uid" => ["attag(96)", "uid"],
-                       "dfrn-id" => ["dfrn-id(64)"],
-                       "issued-id" => ["issued-id(64)"],
                        "network_uid_lastupdate" => ["network", "uid", "last-update"],
                        "uid_network_self_lastupdate" => ["uid", "network", "self", "last-update"],
                        "uid_lastitem" => ["uid", "last-item"],
@@ -259,20 +272,8 @@ return [
                        "uid_contact-type" => ["uid", "contact-type"],
                        "uid_self_contact-type" => ["uid", "self", "contact-type"],
                        "self_network_uid" => ["self", "network", "uid"],
-                       "gsid" => ["gsid"]
-               ]
-       ],
-       "item-uri" => [
-               "comment" => "URI and GUID for items",
-               "fields" => [
-                       "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
-                       "uri" => ["type" => "varbinary(255)", "not null" => "1", "comment" => "URI of an item"],
-                       "guid" => ["type" => "varbinary(255)", "comment" => "A unique identifier for an item"]
-               ],
-               "indexes" => [
-                       "PRIMARY" => ["id"],
-                       "uri" => ["UNIQUE", "uri"],
-                       "guid" => ["guid"]
+                       "gsid" => ["gsid"],
+                       "uri-id" => ["uri-id"],
                ]
        ],
        "tag" => [
@@ -288,21 +289,6 @@ return [
                        "url" => ["url"]
                ]
        ],
-       "clients" => [
-               "comment" => "OAuth usage",
-               "fields" => [
-                       "client_id" => ["type" => "varchar(20)", "not null" => "1", "primary" => "1", "comment" => ""],
-                       "pw" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => ""],
-                       "redirect_uri" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
-                       "name" => ["type" => "text", "comment" => ""],
-                       "icon" => ["type" => "text", "comment" => ""],
-                       "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
-               ],
-               "indexes" => [
-                       "PRIMARY" => ["client_id"],
-                       "uid" => ["uid"],
-               ]
-       ],
        "permissionset" => [
                "comment" => "",
                "fields" => [
@@ -392,6 +378,7 @@ return [
                "comment" => "ActivityPub compatible contacts - used in the ActivityPub implementation",
                "fields" => [
                        "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URL of the contact"],
+                       "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the apcontact url"],
                        "uuid" => ["type" => "varchar(255)", "comment" => ""],
                        "type" => ["type" => "varchar(20)", "not null" => "1", "comment" => ""],
                        "following" => ["type" => "varchar(255)", "comment" => ""],
@@ -400,10 +387,12 @@ return [
                        "outbox" => ["type" => "varchar(255)", "comment" => ""],
                        "sharedinbox" => ["type" => "varchar(255)", "comment" => ""],
                        "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" => ""],
                        "name" => ["type" => "varchar(255)", "comment" => ""],
                        "about" => ["type" => "text", "comment" => ""],
                        "photo" => ["type" => "varchar(255)", "comment" => ""],
+                       "header" => ["type" => "varchar(255)", "comment" => "Header picture"],
                        "addr" => ["type" => "varchar(255)", "comment" => ""],
                        "alias" => ["type" => "varchar(255)", "comment" => ""],
                        "pubkey" => ["type" => "text", "comment" => ""],
@@ -423,7 +412,8 @@ return [
                        "followers" => ["followers(190)"],
                        "baseurl" => ["baseurl(190)"],
                        "sharedinbox" => ["sharedinbox(190)"],
-                       "gsid" => ["gsid"]
+                       "gsid" => ["gsid"],
+                       "uri-id" => ["UNIQUE", "uri-id"],
                ]
        ],
        "application" => [
@@ -489,21 +479,6 @@ return [
                        "uid" => ["uid"],
                ]
        ],
-       "auth_codes" => [
-               "comment" => "OAuth usage",
-               "fields" => [
-                       "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""],
-                       "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "foreign" => ["clients" => "client_id"],
-                               "comment" => ""],
-                       "redirect_uri" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
-                       "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
-                       "scope" => ["type" => "varchar(250)", "not null" => "1", "default" => "", "comment" => ""],
-               ],
-               "indexes" => [
-                       "PRIMARY" => ["id"],
-                       "client_id" => ["client_id"]
-               ]
-       ],
        "cache" => [
                "comment" => "Stores temporary data",
                "fields" => [
@@ -517,21 +492,6 @@ return [
                        "k_expires" => ["k", "expires"],
                ]
        ],
-       "challenge" => [
-               "comment" => "",
-               "fields" => [
-                       "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
-                       "challenge" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                       "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                       "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
-                       "type" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                       "last_update" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-               ],
-               "indexes" => [
-                       "PRIMARY" => ["id"],
-                       "expire" => ["expire"],
-               ]
-       ],
        "config" => [
                "comment" => "main configuration storage",
                "fields" => [
@@ -625,6 +585,7 @@ return [
                        "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
                        "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact_id (ID of the contact in contact table)"],
                        "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+                       "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the event uri"],
                        "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"],
                        "start" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event start time"],
@@ -645,6 +606,7 @@ return [
                        "PRIMARY" => ["id"],
                        "uid_start" => ["uid", "start"],
                        "cid" => ["cid"],
+                       "uri-id" => ["uri-id"],
                ]
        ],
        "fcontact" => [
@@ -653,6 +615,7 @@ return [
                        "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
                        "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "unique id"],
                        "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+                       "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the fcontact url"],
                        "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                        "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                        "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
@@ -672,6 +635,7 @@ return [
                        "PRIMARY" => ["id"],
                        "addr" => ["addr(32)"],
                        "url" => ["UNIQUE", "url(190)"],
+                       "uri-id" => ["UNIQUE", "uri-id"],
                ]
        ],
        "fsuggest" => [
@@ -882,6 +846,29 @@ return [
                        "mid" => ["mid"],
                ]
        ],
+       "notification" => [
+               "comment" => "notifications",
+               "fields" => [
+                       "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
+                       "uid" => ["type" => "mediumint unsigned", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
+                       "vid" => ["type" => "smallint unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"],
+                       "type" => ["type" => "tinyint unsigned", "comment" => ""],
+                       "actor-id" => ["type" => "int unsigned", "foreign" => ["contact" => "id"], "comment" => "Link to the contact table with uid=0 of the actor that caused the notification"],
+                       "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" => ""],
+               ],
+               "indexes" => [
+                       "PRIMARY" => ["id"],
+                       "uid_vid_type_actor-id_target-uri-id" => ["UNIQUE", "uid", "vid", "type", "actor-id", "target-uri-id"],
+                       "vid" => ["vid"],
+                       "actor-id" => ["actor-id"],
+                       "target-uri-id" => ["target-uri-id"],
+                       "parent-uri-id" => ["parent-uri-id"],
+                       "seen_uid" => ["seen", "uid"],
+               ]
+       ],
        "notify" => [
                "comment" => "notifications",
                "fields" => [
@@ -1125,6 +1112,19 @@ return [
                        "PRIMARY" => ["uri-id"],
                ]
        ],
+       "post-link" => [
+               "comment" => "Post related external links",
+               "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"],
+                       "url" => ["type" => "varbinary(511)", "not null" => "1", "comment" => "External URL"],
+                       "mimetype" => ["type" => "varchar(60)", "comment" => ""],
+               ],
+               "indexes" => [
+                       "PRIMARY" => ["id"],
+                       "uri-id-url" => ["UNIQUE", "uri-id", "url"],
+               ]
+       ],
        "post-media" => [
                "comment" => "Attached media",
                "fields" => [
@@ -1285,6 +1285,7 @@ return [
                        "post-user-id" => ["post-user-id"],
                        "commented" => ["commented"],
                        "uid_received" => ["uid", "received"],
+                       "uid_wall_received" => ["uid", "wall", "received"],
                        "uid_pinned" => ["uid", "pinned"],
                        "uid_commented" => ["uid", "commented"],
                        "uid_starred" => ["uid", "starred"],
@@ -1367,22 +1368,6 @@ return [
                        "pub_keywords" => ["FULLTEXT", "pub_keywords"],
                ]
        ],
-       "profile_check" => [
-               "comment" => "DFRN remote auth use",
-               "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"],
-                       "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact.id"],
-                       "dfrn_id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                       "sec" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-                       "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
-               ],
-               "indexes" => [
-                       "PRIMARY" => ["id"],
-                       "uid" => ["uid"],
-                       "cid" => ["cid"],
-               ]
-       ],
        "profile_field" => [
                "comment" => "Custom profile fields",
                "fields" => [
@@ -1475,22 +1460,6 @@ return [
                        "PRIMARY" => ["id"]
                ]
        ],
-       "tokens" => [
-               "comment" => "OAuth usage",
-               "fields" => [
-                       "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""],
-                       "secret" => ["type" => "text", "comment" => ""],
-                       "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "foreign" => ["clients" => "client_id"]],
-                       "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
-                       "scope" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
-                       "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
-               ],
-               "indexes" => [
-                       "PRIMARY" => ["id"],
-                       "client_id" => ["client_id"],
-                       "uid" => ["uid"]
-               ]
-       ],
        "userd" => [
                "comment" => "Deleted usernames",
                "fields" => [