- "item" => [
- "comment" => "Structure for all posts",
- "fields" => [
- "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
- "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this item"],
- "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 item uri"],
- "uri-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
- "parent" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id of the parent to this item if it is a reply of some form; otherwise this must be set to the id of this item"],
- "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "uri of the parent to this item"],
- "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the parent uri"],
- "thr-parent" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "If the parent of this item is not the top-level item in the conversation, the uri of the immediate parent; otherwise set to parent-uri"],
- "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 timestamp."],
- "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last edit (default is created)"],
- "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last comment/reply to this item"],
- "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime"],
- "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"],
- "gravity" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
- "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network from where the item comes from"],
- "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "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", "relation" => ["contact" => "id"], "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"],
- "iaid" => ["type" => "int unsigned", "relation" => ["item-activity" => "id"], "comment" => "Id of the item-activity table entry that contains the activity data"],
- "vid" => ["type" => "smallint unsigned", "relation" => ["verb" => "id"], "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, ...)"],
- "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
- "private" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "0=public, 1=private, 2=unlisted"],
- "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
- "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
- "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been deleted"],
- // User specific fields. Eventually they will move to user-item
- "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
- "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
- "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "This item was posted to the wall of uid"],
- "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item originated at this site"],
- "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
- "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been favourited"],
- "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "item has not been seen"],
- "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "The owner of this item was mentioned in it"],
- "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
- "psid" => ["type" => "int unsigned", "foreign" => ["permissionset" => "id", "on delete" => "restrict"], "comment" => "ID of the permission set of this post"],
- // It has to be decided whether these fields belong to the user or the structure
- "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"],
- "event-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["event" => "id"], "comment" => "Used to link to the event.id"],
- // Could possibly be replaced by the "attach" table?
- "attach" => ["type" => "mediumtext", "comment" => "JSON structure representing attachments to this item"],
- // Deprecated fields. Will be removed in upcoming versions
- "allow_cid" => ["type" => "mediumtext", "comment" => "Deprecated"],
- "allow_gid" => ["type" => "mediumtext", "comment" => "Deprecated"],
- "deny_cid" => ["type" => "mediumtext", "comment" => "Deprecated"],
- "deny_gid" => ["type" => "mediumtext", "comment" => "Deprecated"],
- "postopts" => ["type" => "text", "comment" => "Deprecated"],
- "inform" => ["type" => "mediumtext", "comment" => "Deprecated"],
- "type" => ["type" => "varchar(20)", "comment" => "Deprecated"],
- "bookmark" => ["type" => "boolean", "comment" => "Deprecated"],
- "file" => ["type" => "mediumtext", "comment" => "Deprecated"],
- "location" => ["type" => "varchar(255)", "comment" => "Deprecated"],
- "coord" => ["type" => "varchar(255)", "comment" => "Deprecated"],
- "tag" => ["type" => "mediumtext", "comment" => "Deprecated"],
- "plink" => ["type" => "varchar(255)", "comment" => "Deprecated"],
- "title" => ["type" => "varchar(255)", "comment" => "Deprecated"],
- "content-warning" => ["type" => "varchar(255)", "comment" => "Deprecated"],
- "body" => ["type" => "mediumtext", "comment" => "Deprecated"],
- "app" => ["type" => "varchar(255)", "comment" => "Deprecated"],
- "verb" => ["type" => "varchar(100)", "comment" => "Deprecated"],
- "object-type" => ["type" => "varchar(100)", "comment" => "Deprecated"],
- "object" => ["type" => "text", "comment" => "Deprecated"],
- "target-type" => ["type" => "varchar(100)", "comment" => "Deprecated"],
- "target" => ["type" => "text", "comment" => "Deprecated"],
- "author-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
- "author-link" => ["type" => "varchar(255)", "comment" => "Deprecated"],
- "author-avatar" => ["type" => "varchar(255)", "comment" => "Deprecated"],
- "owner-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
- "owner-link" => ["type" => "varchar(255)", "comment" => "Deprecated"],
- "owner-avatar" => ["type" => "varchar(255)", "comment" => "Deprecated"],
- "rendered-hash" => ["type" => "varchar(32)", "comment" => "Deprecated"],
- "rendered-html" => ["type" => "mediumtext", "comment" => "Deprecated"],
- ],
- "indexes" => [
- "PRIMARY" => ["id"],
- "guid" => ["guid(191)"],
- "uri" => ["uri(191)"],
- "parent" => ["parent"],
- "parent-uri" => ["parent-uri(191)"],
- "extid" => ["extid(191)"],
- "uid_id" => ["uid", "id"],
- "uid_contactid_id" => ["uid", "contact-id", "id"],
- "uid_received" => ["uid", "received"],
- "uid_commented" => ["uid", "commented"],
- "uid_unseen_contactid" => ["uid", "unseen", "contact-id"],
- "uid_network_received" => ["uid", "network", "received"],
- "uid_network_commented" => ["uid", "network", "commented"],
- "uid_thrparent" => ["uid", "thr-parent(190)"],
- "uid_parenturi" => ["uid", "parent-uri(190)"],
- "uid_contactid_received" => ["uid", "contact-id", "received"],
- "authorid_received" => ["author-id", "received"],
- "ownerid" => ["owner-id"],
- "contact-id" => ["contact-id"],
- "uid_uri" => ["uid", "uri(190)"],
- "resource-id" => ["resource-id"],
- "deleted_changed" => ["deleted", "changed"],
- "uid_wall_changed" => ["uid", "wall", "changed"],
- "uid_unseen_wall" => ["uid", "unseen", "wall"],
- "mention_uid_id" => ["mention", "uid", "id"],
- "uid_eventid" => ["uid", "event-id"],
- "icid" => ["icid"],
- "iaid" => ["iaid"],
- "psid_wall" => ["psid", "wall"],
- "uri-id" => ["uri-id"],
- "parent-uri-id" => ["parent-uri-id"],
- "thr-parent-id" => ["thr-parent-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"],
- "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"]
- ]
- ],