]> git.mxchange.org Git - friendica.git/blobdiff - static/dbstructure.config.php
Merge remote-tracking branch 'upstream/develop' into issue-8586
[friendica.git] / static / dbstructure.config.php
index 0c0b289414ec0d73e2481cc97e2807cd792efc84..c2148838989cf5055fea104ba74589a681d7bb43 100755 (executable)
@@ -51,7 +51,7 @@
 use Friendica\Database\DBA;
 
 if (!defined('DB_UPDATE_VERSION')) {
-       define('DB_UPDATE_VERSION', 1335);
+       define('DB_UPDATE_VERSION', 1346);
 }
 
 return [
@@ -317,6 +317,18 @@ return [
                        "issued-id" => ["issued-id(64)"],
                ]
        ],
+       "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"],
+                       "last-interaction" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last interaction"],
+               ],
+               "indexes" => [
+                       "PRIMARY" => ["cid", "relation-cid"],
+                       "relation-cid" => ["relation-cid"],
+               ]
+       ],
        "conv" => [
                "comment" => "private messages",
                "fields" => [
@@ -462,6 +474,7 @@ return [
                        "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" => ""],
@@ -490,6 +503,18 @@ return [
                        "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" => [
@@ -729,12 +754,13 @@ return [
                        "icid" => ["icid"],
                        "iaid" => ["iaid"],
                        "psid_wall" => ["psid", "wall"],
+                       "uri-id" => ["uri-id"],
                ]
        ],
        "item-activity" => [
                "comment" => "Activities for items",
                "fields" => [
-                       "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
+                       "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
                        "uri" => ["type" => "varchar(255)", "comment" => ""],
                        "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
                        "uri-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
@@ -750,7 +776,7 @@ return [
        "item-content" => [
                "comment" => "Content for all posts",
                "fields" => [
-                       "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
+                       "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
                        "uri" => ["type" => "varchar(255)", "comment" => ""],
                        "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
                        "uri-plink-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
@@ -778,25 +804,6 @@ return [
                        "uri-id" => ["uri-id"]
                ]
        ],
-       "item-delivery-data" => [
-               "comment" => "Delivery data for items",
-               "fields" => [
-                       "iid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["item" => "id"], "comment" => "Item id"],
-                       "postopts" => ["type" => "text", "comment" => "External post connectors add their network name to this comma-separated string to identify that they should be delivered to these networks during delivery"],
-                       "inform" => ["type" => "mediumtext", "comment" => "Additional receivers of the linked item"],
-                       "queue_count" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Initial number of delivery recipients, used as item.delivery_queue_count"],
-                       "queue_done" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries, used as item.delivery_queue_done"],
-                       "queue_failed" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of unsuccessful deliveries, used as item.delivery_queue_failed"],
-                       "activitypub" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via ActivityPub"],
-                       "dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via DFRN"],
-                       "legacy_dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via legacy DFRN"],
-                       "diaspora" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via Diaspora"],
-                       "ostatus" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via OStatus"],
-               ],
-               "indexes" => [
-                       "PRIMARY" => ["iid"],
-               ]
-       ],
        "item-uri" => [
                "comment" => "URI and GUID for items",
                "fields" => [
@@ -901,6 +908,8 @@ return [
                        "link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
                        "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id"],
                        "parent" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
+                       "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Item-uri id of the related post"],
+                       "parent-uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related post"],
                        "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
                        "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""],
                        "otype" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => ""],
@@ -919,8 +928,8 @@ return [
                "fields" => [
                        "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
                        "notify-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["notify" => "id"], "comment" => ""],
-                       "master-parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"],
-                               "comment" => ""],
+                       "master-parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
+                       "master-parent-uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related post"],
                        "parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
                        "receiver-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"],
                                "comment" => "User id"],
@@ -1038,6 +1047,7 @@ return [
                        "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
                        "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
                        "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
+                       "accessible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Make photo publicly accessible, ignoring permissions"],
                        "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
                        "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"],
                        "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
@@ -1242,20 +1252,6 @@ return [
                        "expire" => ["expire"],
                ]
        ],
-       "sign" => [
-               "comment" => "Diaspora signatures",
-               "fields" => [
-                       "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
-                       "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id"],
-                       "signed_text" => ["type" => "mediumtext", "comment" => ""],
-                       "signature" => ["type" => "text", "comment" => ""],
-                       "signer" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
-               ],
-               "indexes" => [
-                       "PRIMARY" => ["id"],
-                       "iid" => ["UNIQUE", "iid"],
-               ]
-       ],
        "term" => [
                "comment" => "item taxonomy (categories, tags, etc.) table",
                "fields" => [
@@ -1280,6 +1276,65 @@ return [
                        "guid" => ["guid(64)"],
                ]
        ],
+       "tag" => [
+               "comment" => "tags and mentions",
+               "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" => ""]
+               ],
+               "indexes" => [
+                       "PRIMARY" => ["id"],
+                       "type_name_url" => ["UNIQUE", "name", "url"],
+                       "url" => ["url"]
+               ]
+       ],
+       "post-category" => [
+               "comment" => "post relation to categories",
+               "fields" => [
+                       "uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["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"],
+                       "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "comment" => ""],
+                       "tid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["tag" => "id"], "comment" => ""],
+               ],
+               "indexes" => [
+                       "PRIMARY" => ["uri-id", "uid", "type", "tid"],
+                       "uri-id" => ["tid"]
+               ]
+       ],
+       "post-delivery-data" => [
+               "comment" => "Delivery data for items",
+               "fields" => [
+                       "uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
+                       "postopts" => ["type" => "text", "comment" => "External post connectors add their network name to this comma-separated string to identify that they should be delivered to these networks during delivery"],
+                       "inform" => ["type" => "mediumtext", "comment" => "Additional receivers of the linked item"],
+                       "queue_count" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Initial number of delivery recipients, used as item.delivery_queue_count"],
+                       "queue_done" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries, used as item.delivery_queue_done"],
+                       "queue_failed" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of unsuccessful deliveries, used as item.delivery_queue_failed"],
+                       "activitypub" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via ActivityPub"],
+                       "dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via DFRN"],
+                       "legacy_dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via legacy DFRN"],
+                       "diaspora" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via Diaspora"],
+                       "ostatus" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via OStatus"],
+               ],
+               "indexes" => [
+                       "PRIMARY" => ["uri-id"],
+               ]
+       ],
+       "post-tag" => [
+               "comment" => "post relation to tags",
+               "fields" => [
+                       "uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["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" => ""],
+                       "tid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["tag" => "id"], "comment" => ""],
+                       "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["contact" => "id"], "comment" => "Contact id of the mentioned public contact"],
+               ],
+               "indexes" => [
+                       "PRIMARY" => ["uri-id", "type", "tid", "cid"],
+                       "uri-id" => ["tid"],
+                       "cid" => ["tid"]
+               ]
+       ],
        "thread" => [
                "comment" => "Thread related data",
                "fields" => [