use Friendica\Database\DBA;
if (!defined('DB_UPDATE_VERSION')) {
- define('DB_UPDATE_VERSION', 1348);
+ define('DB_UPDATE_VERSION', 1352);
}
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" => [
"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" => ""],
"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" => ""],
"nick_uid" => ["nick(32)", "uid"],
"dfrn-id" => ["dfrn-id(64)"],
"issued-id" => ["issued-id(64)"],
+ "gsid" => ["gsid"]
]
],
"item-uri" => [
"alias" => ["type" => "varchar(255)", "comment" => ""],
"pubkey" => ["type" => "text", "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"],
"PRIMARY" => ["url"],
"addr" => ["addr(32)"],
"alias" => ["alias(190)"],
- "url" => ["followers(190)"]
+ "followers" => ["followers(190)"],
+ "gsid" => ["gsid"]
]
],
"attach" => [
"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"],
"addr" => ["addr(64)"],
"hide_network_updated" => ["hide", "network", "updated"],
"updated" => ["updated"],
+ "gsid" => ["gsid"]
]
],
"gfollower" => [
"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" => [
"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"],
"uid_commented" => ["uid", "commented"],
"uid_wall_received" => ["uid", "wall", "received"],
"private_wall_origin_commented" => ["private", "wall", "origin", "commented"],
+ "uri-id" => ["uri-id"],
]
],
"tokens" => [