use Friendica\Database\DBA;
if (!defined('DB_UPDATE_VERSION')) {
- define('DB_UPDATE_VERSION', 1391);
+ define('DB_UPDATE_VERSION', 1396);
}
return [
"PRIMARY" => ["uid", "code"]
]
],
+ "2fa_trusted_browser" => [
+ "comment" => "Two-factor authentication trusted browsers",
+ "fields" => [
+ "cookie_hash" => ["type" => "varchar(80)", "not null" => "1", "primary" => "1", "comment" => "Trusted cookie hash"],
+ "uid" => ["type" => "mediumint unsigned", "not null" => "1", "foreign" => ["user" => "uid"], "comment" => "User ID"],
+ "user_agent" => ["type" => "text", "comment" => "User agent string"],
+ "created" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the trusted browser was recorded"],
+ "last_used" => ["type" => "datetime", "comment" => "Datetime the trusted browser was last used"],
+ ],
+ "indexes" => [
+ "PRIMARY" => ["cookie_hash"],
+ "uid" => ["uid"],
+ ]
+ ],
"addon" => [
"comment" => "registered addons",
"fields" => [
"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", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Link to the contact table with uid=0 of the contact that caused the item creation"],
- "icid" => ["type" => "int unsigned", "relation" => ["item-content" => "id"], "comment" => "Id of the item-content table entry that contains the whole item content"],
"vid" => ["type" => "smallint unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"],
"extid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
"post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"],
"event-id" => ["type" => "int unsigned", "relation" => ["event" => "id"], "comment" => "Used to link to the event.id"],
// Deprecated fields. Will be removed in upcoming versions
"iaid" => ["type" => "int unsigned", "comment" => "Deprecated"],
+ "icid" => ["type" => "int unsigned", "comment" => "Deprecated"],
"attach" => ["type" => "mediumtext", "comment" => "Deprecated"],
"allow_cid" => ["type" => "mediumtext", "comment" => "Deprecated"],
"allow_gid" => ["type" => "mediumtext", "comment" => "Deprecated"],
"uid_unseen_wall" => ["uid", "unseen", "wall"],
"mention_uid_id" => ["mention", "uid", "id"],
"uid_eventid" => ["uid", "event-id"],
- "icid" => ["icid"],
- "iaid" => ["iaid"],
"vid" => ["vid"],
"psid_wall" => ["psid", "wall"],
"uri-id" => ["uri-id"],
"causer-id" => ["causer-id"],
]
],
- "item-activity" => [
- "comment" => "Activities for items",
- "fields" => [
- "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
- "uri" => ["type" => "varchar(255)", "comment" => ""],
- "uri-id" => ["type" => "int unsigned", "foreign" => ["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"],
- "activity" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""]
- ],
- "indexes" => [
- "PRIMARY" => ["id"],
- "uri-hash" => ["UNIQUE", "uri-hash"],
- "uri" => ["uri(191)"],
- "uri-id" => ["uri-id"]
- ]
- ],
- "item-content" => [
- "comment" => "Content for all posts",
- "fields" => [
- "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
- "uri" => ["type" => "varchar(255)", "comment" => ""],
- "uri-id" => ["type" => "int unsigned", "foreign" => ["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"],
- "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "item title"],
- "content-warning" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
- "body" => ["type" => "mediumtext", "comment" => "item body content"],
- "raw-body" => ["type" => "mediumtext", "comment" => "Body without embedded media links"],
- "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "text location where this item originated"],
- "coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "longitude/latitude pair representing location where this item originated"],
- "language" => ["type" => "text", "comment" => "Language information about this post"],
- "app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "application which generated this item"],
- "rendered-hash" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
- "rendered-html" => ["type" => "mediumtext", "comment" => "item.body converted to html"],
- "object-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams object type"],
- "object" => ["type" => "text", "comment" => "JSON encoded object structure unless it is an implied object (normal post)"],
- "target-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams target type if applicable (URI)"],
- "target" => ["type" => "text", "comment" => "JSON encoded target structure if used"],
- "plink" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "permalink or URL to a displayable copy of the message at its source"],
- "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams verb"]
- ],
- "indexes" => [
- "PRIMARY" => ["id"],
- "uri-plink-hash" => ["UNIQUE", "uri-plink-hash"],
- "title-content-warning-body" => ["FULLTEXT", "title", "content-warning", "body"],
- "uri" => ["uri(191)"],
- "plink" => ["plink(191)"],
- "uri-id" => ["uri-id"]
- ]
- ],
"locks" => [
"comment" => "",
"fields" => [
"uid" => ["uid"],
]
],
+ "post-content" => [
+ "comment" => "Content for all posts",
+ "fields" => [
+ "uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
+ "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "item title"],
+ "content-warning" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
+ "body" => ["type" => "mediumtext", "comment" => "item body content"],
+ "raw-body" => ["type" => "mediumtext", "comment" => "Body without embedded media links"],
+ "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "text location where this item originated"],
+ "coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "longitude/latitude pair representing location where this item originated"],
+ "language" => ["type" => "text", "comment" => "Language information about this post"],
+ "app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "application which generated this item"],
+ "rendered-hash" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
+ "rendered-html" => ["type" => "mediumtext", "comment" => "item.body converted to html"],
+ "object-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams object type"],
+ "object" => ["type" => "text", "comment" => "JSON encoded object structure unless it is an implied object (normal post)"],
+ "target-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams target type if applicable (URI)"],
+ "target" => ["type" => "text", "comment" => "JSON encoded target structure if used"],
+ "resource-id" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Used to link other tables to items, it identifies the linked resource (e.g. photo) and if set must also set resource_type"],
+ "plink" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "permalink or URL to a displayable copy of the message at its source"]
+ ],
+ "indexes" => [
+ "PRIMARY" => ["uri-id"],
+ "plink" => ["plink(191)"],
+ "title-content-warning-body" => ["FULLTEXT", "title", "content-warning", "body"],
+ ]
+ ],
"post-delivery-data" => [
"comment" => "Delivery data for items",
"fields" => [
"post-user" => [
"comment" => "User specific post data",
"fields" => [
- "uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
- "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
+ "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
+ "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"],
+ "uid" => ["type" => "mediumint unsigned", "not null" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
"protocol" => ["type" => "tinyint unsigned", "comment" => "Protocol used to deliver the item for this user"],
"contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact.id"],
"unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "post has not been seen"],
"psid" => ["type" => "int unsigned", "foreign" => ["permissionset" => "id", "on delete" => "restrict"], "comment" => "ID of the permission set of this post"],
],
"indexes" => [
- "PRIMARY" => ["uid", "uri-id"],
+ "PRIMARY" => ["id"],
+ "uid_uri-id" => ["UNIQUE", "uid", "uri-id"],
"uri-id" => ["uri-id"],
"contact-id" => ["contact-id"],
"psid" => ["psid"],