X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=static%2Fdbstructure.config.php;h=6f455d14e94fb4e7a46b3bd36114a6fa087967c5;hb=0cafa871f1611f283a0f22ec3bb4e3c610028afc;hp=ce3dedf5a05528e62406dc0f47303cf34dcf6f3a;hpb=befc2af5043a3afde251721c0d27df695db1bb7e;p=friendica.git diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index ce3dedf5a0..6f455d14e9 100644 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -55,7 +55,7 @@ use Friendica\Database\DBA; if (!defined('DB_UPDATE_VERSION')) { - define('DB_UPDATE_VERSION', 1412); + define('DB_UPDATE_VERSION', 1434); } 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"], @@ -171,17 +184,20 @@ return [ "about" => ["type" => "text", "comment" => ""], "keywords" => ["type" => "text", "comment" => "public keywords (interests) of the contact"], "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Deprecated"], - "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "XMPP address"], + "matrix" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Matrix address"], "attag" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "avatar" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "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 +209,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 +266,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 +273,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 +290,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 +379,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 +388,14 @@ 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" => ""], + "xmpp" => ["type" => "varchar(255)", "comment" => "XMPP address"], + "matrix" => ["type" => "varchar(255)", "comment" => "Matrix address"], "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 +415,47 @@ return [ "followers" => ["followers(190)"], "baseurl" => ["baseurl(190)"], "sharedinbox" => ["sharedinbox(190)"], - "gsid" => ["gsid"] + "gsid" => ["gsid"], + "uri-id" => ["UNIQUE", "uri-id"], + ] + ], + "application" => [ + "comment" => "OAuth application", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "generated index"], + "client_id" => ["type" => "varchar(64)", "not null" => "1", "comment" => ""], + "client_secret" => ["type" => "varchar(64)", "not null" => "1", "comment" => ""], + "name" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""], + "redirect_uri" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""], + "website" => ["type" => "varchar(255)", "comment" => ""], + "scopes" => ["type" => "varchar(255)", "comment" => ""], + "read" => ["type" => "boolean", "comment" => "Read scope"], + "write" => ["type" => "boolean", "comment" => "Write scope"], + "follow" => ["type" => "boolean", "comment" => "Follow scope"], + "push" => ["type" => "boolean", "comment" => "Push scope"], + ], + "indexes" => [ + "PRIMARY" => ["id"], + "client_id" => ["UNIQUE", "client_id"] + ] + ], + "application-token" => [ + "comment" => "OAuth user token", + "fields" => [ + "application-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["application" => "id"], "comment" => ""], + "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner User id"], + "code" => ["type" => "varchar(64)", "not null" => "1", "comment" => ""], + "access_token" => ["type" => "varchar(64)", "not null" => "1", "comment" => ""], + "created_at" => ["type" => "datetime", "not null" => "1", "comment" => "creation time"], + "scopes" => ["type" => "varchar(255)", "comment" => ""], + "read" => ["type" => "boolean", "comment" => "Read scope"], + "write" => ["type" => "boolean", "comment" => "Write scope"], + "follow" => ["type" => "boolean", "comment" => "Follow scope"], + "push" => ["type" => "boolean", "comment" => "Push scope"], + ], + "indexes" => [ + "PRIMARY" => ["application-id", "uid"], + "uid_id" => ["uid", "application-id"], ] ], "attach" => [ @@ -450,21 +482,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" => [ @@ -478,21 +495,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" => [ @@ -555,6 +557,32 @@ return [ "received" => ["received"], ] ], + "workerqueue" => [ + "comment" => "Background tasks queue entries", + "fields" => [ + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented worker task id"], + "command" => ["type" => "varchar(100)", "comment" => "Task command"], + "parameter" => ["type" => "mediumtext", "comment" => "Task parameter"], + "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Task priority"], + "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date"], + "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process id of the worker"], + "executed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Execution date"], + "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"], + "retrial" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"], + "done" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marked 1 when the task was done - will be deleted later"], + ], + "indexes" => [ + "PRIMARY" => ["id"], + "command" => ["command"], + "done_command_parameter" => ["done", "command", "parameter(64)"], + "done_executed" => ["done", "executed"], + "done_priority_retrial_created" => ["done", "priority", "retrial", "created"], + "done_priority_next_try" => ["done", "priority", "next_try"], + "done_pid_next_try" => ["done", "pid", "next_try"], + "done_pid_retrial" => ["done", "pid", "retrial"], + "done_pid_priority_created" => ["done", "pid", "priority", "created"] + ] + ], "delayed-post" => [ "comment" => "Posts that are about to be distributed at a later time", "fields" => [ @@ -562,10 +590,12 @@ return [ "uri" => ["type" => "varchar(255)", "comment" => "URI of the post that will be distributed later"], "uid" => ["type" => "mediumint unsigned", "foreign" => ["user" => "uid"], "comment" => "Owner User id"], "delayed" => ["type" => "datetime", "comment" => "delay time"], + "wid" => ["type" => "int unsigned", "foreign" => ["workerqueue" => "id"], "comment" => "Workerqueue id"], ], "indexes" => [ "PRIMARY" => ["id"], "uid_uri" => ["UNIQUE", "uid", "uri(190)"], + "wid" => ["wid"], ] ], "diaspora-interaction" => [ @@ -586,6 +616,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"], @@ -606,6 +637,7 @@ return [ "PRIMARY" => ["id"], "uid_start" => ["uid", "start"], "cid" => ["cid"], + "uri-id" => ["uri-id"], ] ], "fcontact" => [ @@ -614,6 +646,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" => ""], @@ -633,6 +666,7 @@ return [ "PRIMARY" => ["id"], "addr" => ["addr(32)"], "url" => ["UNIQUE", "url(190)"], + "uri-id" => ["UNIQUE", "uri-id"], ] ], "fsuggest" => [ @@ -779,6 +813,7 @@ return [ "from-photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "contact photo link of the sender"], "from-url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "profile linke of the sender"], "contact-id" => ["type" => "varchar(255)", "relation" => ["contact" => "id"], "comment" => "contact.id"], + "author-id" => ["type" => "int unsigned", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the author of the mail"], "convid" => ["type" => "int unsigned", "relation" => ["conv" => "id"], "comment" => "conv.id"], "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "body" => ["type" => "mediumtext", "comment" => ""], @@ -787,7 +822,11 @@ return [ "replied" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], "unknown" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if sender not in the contact table this is 1"], "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the related mail"], "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related mail"], + "thr-parent" => ["type" => "varchar(255)", "comment" => ""], + "thr-parent-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"], "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time of the private message"], ], "indexes" => [ @@ -797,6 +836,10 @@ return [ "uri" => ["uri(64)"], "parent-uri" => ["parent-uri(64)"], "contactid" => ["contact-id(32)"], + "author-id" => ["author-id"], + "uri-id" => ["uri-id"], + "parent-uri-id" => ["parent-uri-id"], + "thr-parent-id" => ["thr-parent-id"], ] ], "mailacct" => [ @@ -834,6 +877,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" => [ @@ -998,7 +1064,7 @@ return [ "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the owner of this item"], "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the author of this item"], "causer-id" => ["type" => "int unsigned", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the contact that caused the item creation"], - "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"], + "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, image, article, ...)"], "vid" => ["type" => "smallint unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"], "private" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "0=public, 1=private, 2=unlisted"], "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], @@ -1077,6 +1143,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" => [ @@ -1092,6 +1171,13 @@ return [ "preview-height" => ["type" => "smallint unsigned", "comment" => "Height of the preview picture"], "preview-width" => ["type" => "smallint unsigned", "comment" => "Width of the preview picture"], "description" => ["type" => "text", "comment" => ""], + "name" => ["type" => "varchar(255)", "comment" => "Name of the media"], + "author-url" => ["type" => "varbinary(255)", "comment" => "URL of the author of the media"], + "author-name" => ["type" => "varchar(255)", "comment" => "Name of the author of the media"], + "author-image" => ["type" => "varbinary(255)", "comment" => "Image of the author of the media"], + "publisher-url" => ["type" => "varbinary(255)", "comment" => "URL of the publisher of the media"], + "publisher-name" => ["type" => "varchar(255)", "comment" => "Name of the publisher of the media"], + "publisher-image" => ["type" => "varbinary(255)", "comment" => "Image of the publisher of the media"], ], "indexes" => [ "PRIMARY" => ["id"], @@ -1122,7 +1208,7 @@ return [ "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""], "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], - "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"], + "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" => ""] ], "indexes" => [ @@ -1150,7 +1236,8 @@ return [ "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the owner of this item"], "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the author of this item"], "causer-id" => ["type" => "int unsigned", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the contact that caused the item creation"], - "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"], + "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, image, article, ...)"], + "post-reason" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Reason why the post arrived at the user"], "vid" => ["type" => "smallint unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"], "private" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "0=public, 1=private, 2=unlisted"], "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], @@ -1229,6 +1316,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"], @@ -1299,7 +1387,8 @@ return [ "education" => ["type" => "text", "comment" => "Deprecated"], "contact" => ["type" => "text", "comment" => "Deprecated"], "homepage" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], - "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], + "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "XMPP address"], + "matrix" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Matrix address"], "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "thumb" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish default profile in local directory"], @@ -1311,22 +1400,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" => [ @@ -1419,20 +1492,27 @@ return [ "PRIMARY" => ["id"] ] ], - "tokens" => [ - "comment" => "OAuth usage", + "subscription" => [ + "comment" => "Push Subscription for the API", "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"], + "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented image data id"], + "application-id" => ["type" => "int unsigned", "not null" => "1", "foreign" => ["application" => "id"], "comment" => ""], + "uid" => ["type" => "mediumint unsigned", "not null" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner User id"], + "endpoint" => ["type" => "varchar(511)", "comment" => "Endpoint URL"], + "pubkey" => ["type" => "varchar(127)", "comment" => "User agent public key"], + "secret" => ["type" => "varchar(32)", "comment" => "Auth secret"], + "follow" => ["type" => "boolean", "comment" => ""], + "favourite" => ["type" => "boolean", "comment" => ""], + "reblog" => ["type" => "boolean", "comment" => ""], + "mention" => ["type" => "boolean", "comment" => ""], + "poll" => ["type" => "boolean", "comment" => ""], + "follow_request" => ["type" => "boolean", "comment" => ""], + "status" => ["type" => "boolean", "comment" => ""], ], "indexes" => [ "PRIMARY" => ["id"], - "client_id" => ["client_id"], - "uid" => ["uid"] + "application-id_uid" => ["UNIQUE", "application-id", "uid"], + "uid_application-id" => ["uid", "application-id"], ] ], "userd" => [ @@ -1471,30 +1551,4 @@ return [ ], "engine" => "MEMORY", ], - "workerqueue" => [ - "comment" => "Background tasks queue entries", - "fields" => [ - "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented worker task id"], - "command" => ["type" => "varchar(100)", "comment" => "Task command"], - "parameter" => ["type" => "mediumtext", "comment" => "Task parameter"], - "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Task priority"], - "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date"], - "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process id of the worker"], - "executed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Execution date"], - "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"], - "retrial" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"], - "done" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marked 1 when the task was done - will be deleted later"], - ], - "indexes" => [ - "PRIMARY" => ["id"], - "command" => ["command"], - "done_command_parameter" => ["done", "command", "parameter(64)"], - "done_executed" => ["done", "executed"], - "done_priority_retrial_created" => ["done", "priority", "retrial", "created"], - "done_priority_next_try" => ["done", "priority", "next_try"], - "done_pid_next_try" => ["done", "pid", "next_try"], - "done_pid_retrial" => ["done", "pid", "retrial"], - "done_pid_priority_created" => ["done", "pid", "priority", "created"] - ] - ], ];