3 * @copyright Copyright (C) 2020, Friendica
5 * @license GNU AGPL version 3 or any later version
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Affero General Public License as
9 * published by the Free Software Foundation, either version 3 of the
10 * License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Affero General Public License for more details.
17 * You should have received a copy of the GNU Affero General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 * Main database structure configuration file.
22 * Here are described all the tables, fields and indexes Friendica needs to work.
24 * Syntax (braces indicate optionale values):
26 * "comment" => "Description of the table",
29 * "type" => "<field type>{(<field size>)} <unsigned>",
31 * {"extra" => "auto_increment",}
32 * {"default" => "<default value>",}
33 * {"default" => NULL_DATE,} (for datetime fields)
35 * {"foreign|relation" => ["<foreign key table name>" => "<foreign key field name>"],}
36 * "comment" => "Description of the fields"
41 * "PRIMARY" => ["<primary key field name>", ...],
42 * "<index name>" => [{"UNIQUE",} "<field name>{(<key size>)}", ...]
47 * Whenever possible prefer "foreign" before "relation" with the foreign keys.
48 * "foreign" adds true foreign keys on the database level, while "relation" simulates this behaviour.
50 * If you need to make any change, make sure to increment the DB_UPDATE_VERSION constant value below.
54 use Friendica\Database\DBA;
56 if (!defined('DB_UPDATE_VERSION')) {
57 define('DB_UPDATE_VERSION', 1350);
63 "comment" => "OAuth usage",
65 "client_id" => ["type" => "varchar(20)", "not null" => "1", "primary" => "1", "comment" => ""],
66 "pw" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => ""],
67 "redirect_uri" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
68 "name" => ["type" => "text", "comment" => ""],
69 "icon" => ["type" => "text", "comment" => ""],
70 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
73 "PRIMARY" => ["client_id"],
77 "comment" => "contact table",
79 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
80 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
81 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
82 "updated" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Date of last contact update"],
83 "self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if the contact is the user him/her self"],
84 "remote_self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
85 "rel" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "The kind of the relation between the user and the contact"],
86 "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
87 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network of the contact"],
88 "protocol" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Protocol of the contact"],
89 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"],
90 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"],
91 "location" => ["type" => "varchar(255)", "default" => "", "comment" => ""],
92 "about" => ["type" => "text", "comment" => ""],
93 "keywords" => ["type" => "text", "comment" => "public keywords (interests) of the contact"],
94 "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Deprecated"],
95 "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
96 "attag" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
97 "avatar" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
98 "photo" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo of the contact"],
99 "thumb" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (thumb size)"],
100 "micro" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (micro size)"],
101 "site-pubkey" => ["type" => "text", "comment" => ""],
102 "issued-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
103 "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
104 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
105 "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
106 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
107 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
108 "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
109 "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
110 "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
111 "request" => ["type" => "varchar(255)", "comment" => ""],
112 "notify" => ["type" => "varchar(255)", "comment" => ""],
113 "poll" => ["type" => "varchar(255)", "comment" => ""],
114 "confirm" => ["type" => "varchar(255)", "comment" => ""],
115 "poco" => ["type" => "varchar(255)", "comment" => ""],
116 "aes_allow" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
117 "ret-aes" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
118 "usehub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
119 "subhub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
120 "hub-verify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
121 "last-update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last try to update the contact info"],
122 "success_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful contact update"],
123 "failure_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed update"],
124 "name-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
125 "uri-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
126 "avatar-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
127 "term-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
128 "last-item" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "date of the last post"],
129 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
130 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "Node-wide block status"],
131 "block_reason" => ["type" => "text", "comment" => "Node-wide block reason"],
132 "readonly" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "posts of the contact are readonly"],
133 "writable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
134 "forum" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a forum"],
135 "prv" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a private group"],
136 "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
137 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
138 "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
139 "pending" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
140 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact has been deleted"],
141 "rating" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
142 "unsearchable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact prefers to not be searchable"],
143 "sensitive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact posts sensitive content"],
144 "baseurl" => ["type" => "varchar(255)", "default" => "", "comment" => "baseurl of the contact"],
145 "gsid" => ["type" => "int unsigned", "foreign" => ["gserver" => "id", "on delete" => "restrict"], "comment" => "Global Server ID"],
146 "reason" => ["type" => "text", "comment" => ""],
147 "closeness" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "99", "comment" => ""],
148 "info" => ["type" => "mediumtext", "comment" => ""],
149 "profile-id" => ["type" => "int unsigned", "comment" => "Deprecated"],
150 "bdyear" => ["type" => "varchar(4)", "not null" => "1", "default" => "", "comment" => ""],
151 "bd" => ["type" => "date", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""],
152 "notify_new_posts" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
153 "fetch_further_information" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
154 "ffi_keyword_blacklist" => ["type" => "text", "comment" => ""],
158 "uid_name" => ["uid", "name(190)"],
159 "self_uid" => ["self", "uid"],
160 "alias_uid" => ["alias(32)", "uid"],
161 "pending_uid" => ["pending", "uid"],
162 "blocked_uid" => ["blocked", "uid"],
163 "uid_rel_network_poll" => ["uid", "rel", "network", "poll(64)", "archive"],
164 "uid_network_batch" => ["uid", "network", "batch(64)"],
165 "addr_uid" => ["addr(32)", "uid"],
166 "nurl_uid" => ["nurl(32)", "uid"],
167 "nick_uid" => ["nick(32)", "uid"],
168 "dfrn-id" => ["dfrn-id(64)"],
169 "issued-id" => ["issued-id(64)"],
174 "comment" => "URI and GUID for items",
176 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
177 "uri" => ["type" => "varbinary(255)", "not null" => "1", "comment" => "URI of an item"],
178 "guid" => ["type" => "varbinary(255)", "comment" => "A unique identifier for an item"]
182 "uri" => ["UNIQUE", "uri"],
189 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
190 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner id of this permission set"],
191 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
192 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
193 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
194 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
198 "uid_allow_cid_allow_gid_deny_cid_deny_gid" => ["allow_cid(50)", "allow_gid(30)", "deny_cid(50)", "deny_gid(30)"],
202 "comment" => "tags and mentions",
204 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
205 "name" => ["type" => "varchar(96)", "not null" => "1", "default" => "", "comment" => ""],
206 "url" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""]
210 "type_name_url" => ["UNIQUE", "name", "url"],
215 "2fa_app_specific_password" => [
216 "comment" => "Two-factor app-specific _password",
218 "id" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Password ID for revocation"],
219 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "relation" => ["user" => "uid"], "comment" => "User ID"],
220 "description" => ["type" => "varchar(255)", "comment" => "Description of the usage of the password"],
221 "hashed_password" => ["type" => "varchar(255)", "not null" => "1", "comment" => "Hashed password"],
222 "generated" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the password was generated"],
223 "last_used" => ["type" => "datetime", "comment" => "Datetime the password was last used"],
227 "uid_description" => ["uid", "description(190)"],
230 "2fa_recovery_codes" => [
231 "comment" => "Two-factor authentication recovery codes",
233 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User ID"],
234 "code" => ["type" => "varchar(50)", "not null" => "1", "primary" => "1", "comment" => "Recovery code string"],
235 "generated" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the code was generated"],
236 "used" => ["type" => "datetime", "comment" => "Datetime the code was used"],
239 "PRIMARY" => ["uid", "code"]
243 "comment" => "registered addons",
245 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
246 "name" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "addon base (file)name"],
247 "version" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "currently unused"],
248 "installed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently always 1"],
249 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently unused"],
250 "timestamp" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "file timestamp to check for reloads"],
251 "plugin_admin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = has admin config, 0 = has no admin config"],
255 "name" => ["UNIQUE", "name"],
259 "comment" => "ActivityPub compatible contacts - used in the ActivityPub implementation",
261 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URL of the contact"],
262 "uuid" => ["type" => "varchar(255)", "comment" => ""],
263 "type" => ["type" => "varchar(20)", "not null" => "1", "comment" => ""],
264 "following" => ["type" => "varchar(255)", "comment" => ""],
265 "followers" => ["type" => "varchar(255)", "comment" => ""],
266 "inbox" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
267 "outbox" => ["type" => "varchar(255)", "comment" => ""],
268 "sharedinbox" => ["type" => "varchar(255)", "comment" => ""],
269 "manually-approve" => ["type" => "boolean", "comment" => ""],
270 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
271 "name" => ["type" => "varchar(255)", "comment" => ""],
272 "about" => ["type" => "text", "comment" => ""],
273 "photo" => ["type" => "varchar(255)", "comment" => ""],
274 "addr" => ["type" => "varchar(255)", "comment" => ""],
275 "alias" => ["type" => "varchar(255)", "comment" => ""],
276 "pubkey" => ["type" => "text", "comment" => ""],
277 "baseurl" => ["type" => "varchar(255)", "comment" => "baseurl of the ap contact"],
278 "gsid" => ["type" => "int unsigned", "foreign" => ["gserver" => "id", "on delete" => "restrict"], "comment" => "Global Server ID"],
279 "generator" => ["type" => "varchar(255)", "comment" => "Name of the contact's system"],
280 "following_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of following contacts"],
281 "followers_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of followers"],
282 "statuses_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of posts"],
283 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
286 "PRIMARY" => ["url"],
287 "addr" => ["addr(32)"],
288 "alias" => ["alias(190)"],
289 "followers" => ["followers(190)"],
294 "comment" => "file attachments",
296 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "generated index"],
297 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
298 "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "hash"],
299 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "filename of original"],
300 "filetype" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "mimetype"],
301 "filesize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "size in bytes"],
302 "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"],
303 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
304 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
305 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>"],
306 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
307 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
308 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
309 "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
310 "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"],
317 "comment" => "OAuth usage",
319 "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""],
320 "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "foreign" => ["clients" => "client_id"],
322 "redirect_uri" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
323 "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
324 "scope" => ["type" => "varchar(250)", "not null" => "1", "default" => "", "comment" => ""],
328 "client_id" => ["client_id"]
332 "comment" => "Stores temporary data",
334 "k" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "cache key"],
335 "v" => ["type" => "mediumtext", "comment" => "cached serialized value"],
336 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
337 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache insertion"],
341 "k_expires" => ["k", "expires"],
347 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
348 "challenge" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
349 "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
350 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
351 "type" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
352 "last_update" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
359 "comment" => "main configuration storage",
361 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
362 "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
363 "k" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
364 "v" => ["type" => "mediumtext", "comment" => ""],
368 "cat_k" => ["UNIQUE", "cat", "k"],
371 "contact-relation" => [
372 "comment" => "Contact relations",
374 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "primary" => "1", "comment" => "contact the related contact had interacted with"],
375 "relation-cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "primary" => "1", "comment" => "related contact who had interacted with the contact"],
376 "last-interaction" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last interaction"],
379 "PRIMARY" => ["cid", "relation-cid"],
380 "relation-cid" => ["relation-cid"],
384 "comment" => "private messages",
386 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
387 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this conversation"],
388 "recips" => ["type" => "text", "comment" => "sender_handle;recipient_handle"],
389 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
390 "creator" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "handle of creator"],
391 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation timestamp"],
392 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "edited timestamp"],
393 "subject" => ["type" => "text", "comment" => "subject of initial message"],
401 "comment" => "Raw data and structure information for messages",
403 "item-uri" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "Original URI of the item - unrelated to the table with the same name"],
404 "reply-to-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "URI to which this item is a reply"],
405 "conversation-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation URI"],
406 "conversation-href" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation link"],
407 "protocol" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "255", "comment" => "The protocol of the item"],
408 "direction" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "How the message arrived here: 1=push, 2=pull"],
409 "source" => ["type" => "mediumtext", "comment" => "Original source"],
410 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Receiving date"],
413 "PRIMARY" => ["item-uri"],
414 "conversation-uri" => ["conversation-uri"],
415 "received" => ["received"],
418 "diaspora-interaction" => [
419 "comment" => "Signed Diaspora Interaction",
421 "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"],
422 "interaction" => ["type" => "mediumtext", "comment" => "The Diaspora interaction"]
425 "PRIMARY" => ["uri-id"]
429 "comment" => "Events",
431 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
432 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
433 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
434 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact_id (ID of the contact in contact table)"],
435 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
436 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
437 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
438 "start" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event start time"],
439 "finish" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event end time"],
440 "summary" => ["type" => "text", "comment" => "short description or title of the event"],
441 "desc" => ["type" => "text", "comment" => "event description"],
442 "location" => ["type" => "text", "comment" => "event location"],
443 "type" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => "event or birthday"],
444 "nofinish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if event does have no end this is 1"],
445 "adjust" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "adjust to timezone of the recipient (0 or 1)"],
446 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "0 or 1"],
447 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
448 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
449 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
450 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
454 "uid_start" => ["uid", "start"],
458 "comment" => "Diaspora compatible contacts - used in the Diaspora implementation",
460 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
461 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "unique id"],
462 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
463 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
464 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
465 "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
466 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
467 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
468 "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
469 "notify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
470 "poll" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
471 "confirm" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
472 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
473 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
474 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
475 "pubkey" => ["type" => "text", "comment" => ""],
476 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
480 "addr" => ["addr(32)"],
481 "url" => ["UNIQUE", "url(190)"],
485 "comment" => "friend suggestion stuff",
487 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
488 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
489 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
490 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
491 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
492 "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
493 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
494 "note" => ["type" => "text", "comment" => ""],
495 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
502 "comment" => "contacts ignored by friend suggestions",
504 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
505 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Local User id"],
506 "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => "gcontact.id of ignored contact"],
515 "comment" => "global contacts",
517 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
518 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"],
519 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"],
520 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the contacts profile page"],
521 "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
522 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the profile photo"],
523 "connect" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
524 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
525 "updated" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
526 "last_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
527 "last_failure" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
528 "last_discovery" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last contact discovery"],
529 "archive_date" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
530 "archived" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
531 "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
532 "about" => ["type" => "text", "comment" => ""],
533 "keywords" => ["type" => "text", "comment" => "puplic keywords (interests)"],
534 "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Deprecated"],
535 "birthday" => ["type" => "varchar(32)", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""],
536 "community" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if contact is forum account"],
537 "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "-1", "comment" => ""],
538 "hide" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = should be hidden from search"],
539 "nsfw" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = contact posts nsfw content"],
540 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "social network protocol"],
541 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
542 "notify" => ["type" => "varchar(255)", "comment" => ""],
543 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
544 "generation" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
545 "server_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "baseurl of the contacts server"],
546 "gsid" => ["type" => "int unsigned", "foreign" => ["gserver" => "id", "on delete" => "restrict"], "comment" => "Global Server ID"],
550 "nurl" => ["UNIQUE", "nurl(190)"],
551 "name" => ["name(64)"],
552 "nick" => ["nick(32)"],
553 "addr" => ["addr(64)"],
554 "hide_network_updated" => ["hide", "network", "updated"],
555 "updated" => ["updated"],
560 "comment" => "Followers of global contacts",
562 "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["gcontact" => "id"], "comment" => "global contact"],
563 "follower-gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["gcontact" => "id"], "comment" => "global contact of the follower"],
564 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates that the connection has been deleted"],
567 "PRIMARY" => ["gcid", "follower-gcid"],
568 "follower-gcid" => ["follower-gcid"],
572 "comment" => "'friends of friends' linkages derived from poco",
574 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
575 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
576 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
577 "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
578 "zcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
579 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
583 "cid_uid_gcid_zcid" => ["UNIQUE", "cid", "uid", "gcid", "zcid"],
588 "comment" => "privacy groups, group info",
590 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
591 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
592 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the member list is not private"],
593 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the group has been deleted"],
594 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "human readable name of group"],
602 "comment" => "privacy groups, member info",
604 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
605 "gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["group" => "id"], "comment" => "groups.id of the associated group"],
606 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id of the member assigned to the associated group"],
610 "contactid" => ["contact-id"],
611 "gid_contactid" => ["UNIQUE", "gid", "contact-id"],
615 "comment" => "Global servers",
617 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
618 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
619 "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
620 "version" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
621 "site_name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
622 "info" => ["type" => "text", "comment" => ""],
623 "register_policy" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
624 "registered-users" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Number of registered users"],
625 "directory-type" => ["type" => "tinyint", "default" => "0", "comment" => "Type of directory service (Poco, Mastodon)"],
626 "poco" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
627 "noscrape" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
628 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
629 "platform" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
630 "relay-subscribe" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Has the server subscribed to the relay system"],
631 "relay-scope" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => "The scope of messages that the server wants to get"],
632 "detection-method" => ["type" => "tinyint unsigned", "comment" => "Method that had been used to detect that server"],
633 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
634 "last_poco_query" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
635 "last_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
636 "last_failure" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
640 "nurl" => ["UNIQUE", "nurl(190)"],
644 "comment" => "Tags that the server has subscribed",
646 "gserver-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gserver" => "id"], "primary" => "1",
647 "comment" => "The id of the gserver"],
648 "tag" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "primary" => "1", "comment" => "Tag that the server has subscribed"],
651 "PRIMARY" => ["gserver-id", "tag"],
656 "comment" => "addon hook registry",
658 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
659 "hook" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => "name of hook"],
660 "file" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "relative filename of hook handler"],
661 "function" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "function name of hook handler"],
662 "priority" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => "not yet implemented - can be used to sort conflicts in hook handling by calling handlers in priority order"],
666 "hook_file_function" => ["UNIQUE", "hook", "file", "function"],
670 "comment" => "Status of ActivityPub inboxes",
672 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URL of the inbox"],
673 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date of this entry"],
674 "success" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful delivery"],
675 "failure" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed delivery"],
676 "previous" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Previous delivery date"],
677 "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the inbox archived?"],
678 "shared" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is it a shared inbox?"]
687 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
688 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
689 "fid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["fcontact" => "id"], "comment" => ""],
690 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
691 "knowyou" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
692 "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
693 "note" => ["type" => "text", "comment" => ""],
694 "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
695 "datetime" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
696 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
697 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
704 "comment" => "Structure for all posts",
706 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
707 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this item"],
708 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
709 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
710 "uri-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
711 "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"],
712 "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "uri of the parent to this item"],
713 "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the parent uri"],
714 "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"],
715 "thr-parent-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"],
716 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation timestamp."],
717 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last edit (default is created)"],
718 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last comment/reply to this item"],
719 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime"],
720 "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"],
721 "gravity" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
722 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network from where the item comes from"],
723 "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"],
724 "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"],
725 "icid" => ["type" => "int unsigned", "relation" => ["item-content" => "id"], "comment" => "Id of the item-content table entry that contains the whole item content"],
726 "iaid" => ["type" => "int unsigned", "relation" => ["item-activity" => "id"], "comment" => "Id of the item-activity table entry that contains the activity data"],
727 "vid" => ["type" => "smallint unsigned", "relation" => ["verb" => "id"], "comment" => "Id of the verb table entry that contains the activity verbs"],
728 "extid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
729 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"],
730 "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
731 "private" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "0=public, 1=private, 2=unlisted"],
732 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
733 "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
734 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been deleted"],
735 // User specific fields. Eventually they will move to user-item
736 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
737 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
738 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "This item was posted to the wall of uid"],
739 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item originated at this site"],
740 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
741 "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been favourited"],
742 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "item has not been seen"],
743 "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "The owner of this item was mentioned in it"],
744 "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
745 "psid" => ["type" => "int unsigned", "foreign" => ["permissionset" => "id", "on delete" => "restrict"], "comment" => "ID of the permission set of this post"],
746 // It has to be decided whether these fields belong to the user or the structure
747 "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"],
748 "event-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["event" => "id"], "comment" => "Used to link to the event.id"],
749 // Could possibly be replaced by the "attach" table?
750 "attach" => ["type" => "mediumtext", "comment" => "JSON structure representing attachments to this item"],
751 // Deprecated fields. Will be removed in upcoming versions
752 "allow_cid" => ["type" => "mediumtext", "comment" => "Deprecated"],
753 "allow_gid" => ["type" => "mediumtext", "comment" => "Deprecated"],
754 "deny_cid" => ["type" => "mediumtext", "comment" => "Deprecated"],
755 "deny_gid" => ["type" => "mediumtext", "comment" => "Deprecated"],
756 "postopts" => ["type" => "text", "comment" => "Deprecated"],
757 "inform" => ["type" => "mediumtext", "comment" => "Deprecated"],
758 "type" => ["type" => "varchar(20)", "comment" => "Deprecated"],
759 "bookmark" => ["type" => "boolean", "comment" => "Deprecated"],
760 "file" => ["type" => "mediumtext", "comment" => "Deprecated"],
761 "location" => ["type" => "varchar(255)", "comment" => "Deprecated"],
762 "coord" => ["type" => "varchar(255)", "comment" => "Deprecated"],
763 "tag" => ["type" => "mediumtext", "comment" => "Deprecated"],
764 "plink" => ["type" => "varchar(255)", "comment" => "Deprecated"],
765 "title" => ["type" => "varchar(255)", "comment" => "Deprecated"],
766 "content-warning" => ["type" => "varchar(255)", "comment" => "Deprecated"],
767 "body" => ["type" => "mediumtext", "comment" => "Deprecated"],
768 "app" => ["type" => "varchar(255)", "comment" => "Deprecated"],
769 "verb" => ["type" => "varchar(100)", "comment" => "Deprecated"],
770 "object-type" => ["type" => "varchar(100)", "comment" => "Deprecated"],
771 "object" => ["type" => "text", "comment" => "Deprecated"],
772 "target-type" => ["type" => "varchar(100)", "comment" => "Deprecated"],
773 "target" => ["type" => "text", "comment" => "Deprecated"],
774 "author-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
775 "author-link" => ["type" => "varchar(255)", "comment" => "Deprecated"],
776 "author-avatar" => ["type" => "varchar(255)", "comment" => "Deprecated"],
777 "owner-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
778 "owner-link" => ["type" => "varchar(255)", "comment" => "Deprecated"],
779 "owner-avatar" => ["type" => "varchar(255)", "comment" => "Deprecated"],
780 "rendered-hash" => ["type" => "varchar(32)", "comment" => "Deprecated"],
781 "rendered-html" => ["type" => "mediumtext", "comment" => "Deprecated"],
785 "guid" => ["guid(191)"],
786 "uri" => ["uri(191)"],
787 "parent" => ["parent"],
788 "parent-uri" => ["parent-uri(191)"],
789 "extid" => ["extid(191)"],
790 "uid_id" => ["uid", "id"],
791 "uid_contactid_id" => ["uid", "contact-id", "id"],
792 "uid_received" => ["uid", "received"],
793 "uid_commented" => ["uid", "commented"],
794 "uid_unseen_contactid" => ["uid", "unseen", "contact-id"],
795 "uid_network_received" => ["uid", "network", "received"],
796 "uid_network_commented" => ["uid", "network", "commented"],
797 "uid_thrparent" => ["uid", "thr-parent(190)"],
798 "uid_parenturi" => ["uid", "parent-uri(190)"],
799 "uid_contactid_received" => ["uid", "contact-id", "received"],
800 "authorid_received" => ["author-id", "received"],
801 "ownerid" => ["owner-id"],
802 "contact-id" => ["contact-id"],
803 "uid_uri" => ["uid", "uri(190)"],
804 "resource-id" => ["resource-id"],
805 "deleted_changed" => ["deleted", "changed"],
806 "uid_wall_changed" => ["uid", "wall", "changed"],
807 "mention_uid_id" => ["mention", "uid", "id"],
808 "uid_eventid" => ["uid", "event-id"],
811 "psid_wall" => ["psid", "wall"],
812 "uri-id" => ["uri-id"],
813 "parent-uri-id" => ["parent-uri-id"],
814 "thr-parent-id" => ["thr-parent-id"],
818 "comment" => "Activities for items",
820 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
821 "uri" => ["type" => "varchar(255)", "comment" => ""],
822 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
823 "uri-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
824 "activity" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""]
828 "uri-hash" => ["UNIQUE", "uri-hash"],
829 "uri" => ["uri(191)"],
830 "uri-id" => ["uri-id"]
834 "comment" => "Content for all posts",
836 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
837 "uri" => ["type" => "varchar(255)", "comment" => ""],
838 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
839 "uri-plink-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
840 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "item title"],
841 "content-warning" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
842 "body" => ["type" => "mediumtext", "comment" => "item body content"],
843 "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "text location where this item originated"],
844 "coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "longitude/latitude pair representing location where this item originated"],
845 "language" => ["type" => "text", "comment" => "Language information about this post"],
846 "app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "application which generated this item"],
847 "rendered-hash" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
848 "rendered-html" => ["type" => "mediumtext", "comment" => "item.body converted to html"],
849 "object-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams object type"],
850 "object" => ["type" => "text", "comment" => "JSON encoded object structure unless it is an implied object (normal post)"],
851 "target-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams target type if applicable (URI)"],
852 "target" => ["type" => "text", "comment" => "JSON encoded target structure if used"],
853 "plink" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "permalink or URL to a displayable copy of the message at its source"],
854 "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams verb"]
858 "uri-plink-hash" => ["UNIQUE", "uri-plink-hash"],
859 "uri" => ["uri(191)"],
860 "plink" => ["plink(191)"],
861 "uri-id" => ["uri-id"]
867 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
868 "name" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => ""],
869 "locked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
870 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process ID"],
871 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
875 "name_expires" => ["name", "expires"]
879 "comment" => "private messages",
881 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
882 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
883 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this private message"],
884 "from-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "name of the sender"],
885 "from-photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "contact photo link of the sender"],
886 "from-url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "profile linke of the sender"],
887 "contact-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "relation" => ["contact" => "id"], "comment" => "contact.id"],
888 "convid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["conv" => "id"], "comment" => "conv.id"],
889 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
890 "body" => ["type" => "mediumtext", "comment" => ""],
891 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if message visited it is 1"],
892 "reply" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
893 "replied" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
894 "unknown" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if sender not in the contact table this is 1"],
895 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
896 "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
897 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time of the private message"],
901 "uid_seen" => ["uid", "seen"],
902 "convid" => ["convid"],
903 "uri" => ["uri(64)"],
904 "parent-uri" => ["parent-uri(64)"],
905 "contactid" => ["contact-id(32)"],
909 "comment" => "Mail account data for fetching mails",
911 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
912 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
913 "server" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
914 "port" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
915 "ssltype" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
916 "mailbox" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
917 "user" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
918 "pass" => ["type" => "text", "comment" => ""],
919 "reply_to" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
920 "action" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
921 "movetofolder" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
922 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
923 "last_check" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
930 "comment" => "table of accounts that can manage each other",
932 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
933 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
934 "mid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
938 "uid_mid" => ["UNIQUE", "uid", "mid"],
942 "comment" => "notifications",
944 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
945 "type" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
946 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
947 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
948 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
949 "date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
950 "msg" => ["type" => "mediumtext", "comment" => ""],
951 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
952 "link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
953 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id"],
954 "parent" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
955 "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Item-uri id of the related post"],
956 "parent-uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related post"],
957 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
958 "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""],
959 "otype" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => ""],
960 "name_cache" => ["type" => "tinytext", "comment" => "Cached bbcode parsing of name"],
961 "msg_cache" => ["type" => "mediumtext", "comment" => "Cached bbcode parsing of msg"]
965 "seen_uid_date" => ["seen", "uid", "date"],
966 "uid_date" => ["uid", "date"],
967 "uid_type_link" => ["uid", "type", "link(190)"],
970 "notify-threads" => [
973 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
974 "notify-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["notify" => "id"], "comment" => ""],
975 "master-parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
976 "master-parent-uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related post"],
977 "parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
978 "receiver-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"],
979 "comment" => "User id"],
983 "master-parent-uri-id" => ["master-parent-uri-id"],
987 "comment" => "cache for OEmbed queries",
989 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
990 "maxwidth" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "comment" => "Maximum width passed to Oembed"],
991 "content" => ["type" => "mediumtext", "comment" => "OEmbed data of the page"],
992 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
995 "PRIMARY" => ["url", "maxwidth"],
996 "created" => ["created"],
999 "openwebauth-token" => [
1000 "comment" => "Store OpenWebAuth token to verify contacts",
1002 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1003 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1004 "type" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Verify type"],
1005 "token" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A generated token"],
1006 "meta" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1007 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
1010 "PRIMARY" => ["id"],
1014 "comment" => "cache for 'parse_url' queries",
1016 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
1017 "guessing" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the 'guessing' mode active?"],
1018 "oembed" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the data the result of oembed?"],
1019 "content" => ["type" => "mediumtext", "comment" => "page data"],
1020 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
1023 "PRIMARY" => ["url", "guessing", "oembed"],
1024 "created" => ["created"],
1027 "participation" => [
1028 "comment" => "Storage for participation messages from Diaspora",
1030 "iid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["item" => "id"], "comment" => ""],
1031 "server" => ["type" => "varchar(60)", "not null" => "1", "primary" => "1", "comment" => ""],
1032 "cid" => ["type" => "int unsigned", "not null" => "1", "relation" => ["contact" => "id"], "comment" => ""],
1033 "fid" => ["type" => "int unsigned", "not null" => "1", "relation" => ["fcontact" => "id"], "comment" => ""],
1036 "PRIMARY" => ["iid", "server"],
1042 "comment" => "personal (per user) configuration storage",
1044 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
1045 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1046 "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
1047 "k" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => ""],
1048 "v" => ["type" => "mediumtext", "comment" => ""],
1051 "PRIMARY" => ["id"],
1052 "uid_cat_k" => ["UNIQUE", "uid", "cat", "k"],
1056 "comment" => "photo storage",
1058 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1059 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
1060 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
1061 "guid" => ["type" => "char(16)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this photo"],
1062 "resource-id" => ["type" => "char(32)", "not null" => "1", "default" => "", "comment" => ""],
1063 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation date"],
1064 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edited date"],
1065 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1066 "desc" => ["type" => "text", "comment" => ""],
1067 "album" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "The name of the album to which the photo belongs"],
1068 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1069 "type" => ["type" => "varchar(30)", "not null" => "1", "default" => "image/jpeg"],
1070 "height" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1071 "width" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1072 "datasize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1073 "data" => ["type" => "mediumblob", "not null" => "1", "comment" => ""],
1074 "scale" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1075 "profile" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1076 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
1077 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
1078 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
1079 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
1080 "accessible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Make photo publicly accessible, ignoring permissions"],
1081 "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
1082 "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"],
1083 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
1086 "PRIMARY" => ["id"],
1087 "contactid" => ["contact-id"],
1088 "uid_contactid" => ["uid", "contact-id"],
1089 "uid_profile" => ["uid", "profile"],
1090 "uid_album_scale_created" => ["uid", "album(32)", "scale", "created"],
1091 "uid_album_resource-id_created" => ["uid", "album(32)", "resource-id", "created"],
1092 "resource-id" => ["resource-id"],
1096 "comment" => "Currently unused table for storing poll results",
1098 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
1099 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1100 "q0" => ["type" => "text", "comment" => ""],
1101 "q1" => ["type" => "text", "comment" => ""],
1102 "q2" => ["type" => "text", "comment" => ""],
1103 "q3" => ["type" => "text", "comment" => ""],
1104 "q4" => ["type" => "text", "comment" => ""],
1105 "q5" => ["type" => "text", "comment" => ""],
1106 "q6" => ["type" => "text", "comment" => ""],
1107 "q7" => ["type" => "text", "comment" => ""],
1108 "q8" => ["type" => "text", "comment" => ""],
1109 "q9" => ["type" => "text", "comment" => ""],
1112 "PRIMARY" => ["id"],
1117 "comment" => "data for polls - currently unused",
1119 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1120 "poll_id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["poll" => "id"]],
1121 "choice" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1124 "PRIMARY" => ["id"],
1125 "poll_id" => ["poll_id"],
1128 "post-category" => [
1129 "comment" => "post relation to categories",
1131 "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"],
1132 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
1133 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "comment" => ""],
1134 "tid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["tag" => "id", "on delete" => "restrict"], "comment" => ""],
1137 "PRIMARY" => ["uri-id", "uid", "type", "tid"],
1141 "post-delivery-data" => [
1142 "comment" => "Delivery data for items",
1144 "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"],
1145 "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"],
1146 "inform" => ["type" => "mediumtext", "comment" => "Additional receivers of the linked item"],
1147 "queue_count" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Initial number of delivery recipients, used as item.delivery_queue_count"],
1148 "queue_done" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries, used as item.delivery_queue_done"],
1149 "queue_failed" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of unsuccessful deliveries, used as item.delivery_queue_failed"],
1150 "activitypub" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via ActivityPub"],
1151 "dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via DFRN"],
1152 "legacy_dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via legacy DFRN"],
1153 "diaspora" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via Diaspora"],
1154 "ostatus" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via OStatus"],
1157 "PRIMARY" => ["uri-id"],
1161 "comment" => "post relation to tags",
1163 "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"],
1164 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "comment" => ""],
1165 "tid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["tag" => "id", "on delete" => "restrict"], "comment" => ""],
1166 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Contact id of the mentioned public contact"],
1169 "PRIMARY" => ["uri-id", "type", "tid", "cid"],
1175 "comment" => "Currently running system processes",
1177 "pid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "comment" => ""],
1178 "command" => ["type" => "varbinary(32)", "not null" => "1", "default" => "", "comment" => ""],
1179 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1182 "PRIMARY" => ["pid"],
1183 "command" => ["command"],
1187 "comment" => "user profiles data",
1189 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1190 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
1191 "profile-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1192 "is-default" => ["type" => "boolean", "comment" => "Deprecated"],
1193 "hide-friends" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide friend list from viewers of this profile"],
1194 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1195 "pdesc" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1196 "dob" => ["type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00", "comment" => "Day of birth"],
1197 "address" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1198 "locality" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1199 "region" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1200 "postal-code" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1201 "country-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1202 "hometown" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1203 "gender" => ["type" => "varchar(32)", "comment" => "Deprecated"],
1204 "marital" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1205 "with" => ["type" => "text", "comment" => "Deprecated"],
1206 "howlong" => ["type" => "datetime", "comment" => "Deprecated"],
1207 "sexual" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1208 "politic" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1209 "religion" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1210 "pub_keywords" => ["type" => "text", "comment" => ""],
1211 "prv_keywords" => ["type" => "text", "comment" => ""],
1212 "likes" => ["type" => "text", "comment" => "Deprecated"],
1213 "dislikes" => ["type" => "text", "comment" => "Deprecated"],
1214 "about" => ["type" => "text", "comment" => "Profile description"],
1215 "summary" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1216 "music" => ["type" => "text", "comment" => "Deprecated"],
1217 "book" => ["type" => "text", "comment" => "Deprecated"],
1218 "tv" => ["type" => "text", "comment" => "Deprecated"],
1219 "film" => ["type" => "text", "comment" => "Deprecated"],
1220 "interest" => ["type" => "text", "comment" => "Deprecated"],
1221 "romance" => ["type" => "text", "comment" => "Deprecated"],
1222 "work" => ["type" => "text", "comment" => "Deprecated"],
1223 "education" => ["type" => "text", "comment" => "Deprecated"],
1224 "contact" => ["type" => "text", "comment" => "Deprecated"],
1225 "homepage" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1226 "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1227 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1228 "thumb" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1229 "publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish default profile in local directory"],
1230 "net-publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish profile in global directory"],
1233 "PRIMARY" => ["id"],
1234 "uid_is-default" => ["uid", "is-default"],
1235 "pub_keywords" => ["FULLTEXT", "pub_keywords"],
1238 "profile_check" => [
1239 "comment" => "DFRN remote auth use",
1241 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1242 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1243 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
1244 "dfrn_id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1245 "sec" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1246 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1249 "PRIMARY" => ["id"],
1252 "profile_field" => [
1253 "comment" => "Custom profile fields",
1255 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1256 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner user id"],
1257 "order" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "1", "comment" => "Field ordering per user"],
1258 "psid" => ["type" => "int unsigned", "foreign" => ["permissionset" => "id", "on delete" => "restrict"], "comment" => "ID of the permission set of this profile field - 0 = public"],
1259 "label" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Label of the field"],
1260 "value" => ["type" => "text", "comment" => "Value of the field"],
1261 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
1262 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
1265 "PRIMARY" => ["id"],
1267 "order" => ["order"],
1271 "push_subscriber" => [
1272 "comment" => "Used for OStatus: Contains feed subscribers",
1274 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1275 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1276 "callback_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1277 "topic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1278 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1279 "push" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1280 "last_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last successful trial"],
1281 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1282 "renewed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last subscription renewal"],
1283 "secret" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1286 "PRIMARY" => ["id"],
1287 "next_try" => ["next_try"],
1291 "comment" => "registrations requiring admin approval",
1293 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1294 "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1295 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1296 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1297 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1298 "language" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
1299 "note" => ["type" => "text", "comment" => ""],
1302 "PRIMARY" => ["id"],
1308 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1309 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1310 "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1313 "PRIMARY" => ["id"],
1318 "comment" => "web session storage",
1320 "id" => ["type" => "bigint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1321 "sid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
1322 "data" => ["type" => "text", "comment" => ""],
1323 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1326 "PRIMARY" => ["id"],
1327 "sid" => ["sid(64)"],
1328 "expire" => ["expire"],
1332 "comment" => "Data stored by Database storage backend",
1334 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented image data id"],
1335 "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"]
1342 "comment" => "Thread related data",
1344 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"],
1345 "comment" => "sequential ID"],
1346 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1347 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
1348 "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item owner"],
1349 "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item author"],
1350 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1351 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1352 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1353 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1354 "changed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1355 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1356 "private" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "0=public, 1=private, 2=unlisted"],
1357 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1358 "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1359 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1360 "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1361 "ignored" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1362 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"],
1363 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
1364 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1365 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1366 "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1367 "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1368 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
1369 "bookmark" => ["type" => "boolean", "comment" => ""],
1372 "PRIMARY" => ["iid"],
1373 "uid_network_commented" => ["uid", "network", "commented"],
1374 "uid_network_received" => ["uid", "network", "received"],
1375 "uid_contactid_commented" => ["uid", "contact-id", "commented"],
1376 "uid_contactid_received" => ["uid", "contact-id", "received"],
1377 "contactid" => ["contact-id"],
1378 "ownerid" => ["owner-id"],
1379 "authorid" => ["author-id"],
1380 "uid_received" => ["uid", "received"],
1381 "uid_commented" => ["uid", "commented"],
1382 "uid_wall_received" => ["uid", "wall", "received"],
1383 "private_wall_origin_commented" => ["private", "wall", "origin", "commented"],
1387 "comment" => "OAuth usage",
1389 "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""],
1390 "secret" => ["type" => "text", "comment" => ""],
1391 "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "foreign" => ["clients" => "client_id"]],
1392 "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
1393 "scope" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
1394 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1397 "PRIMARY" => ["id"],
1398 "client_id" => ["client_id"]
1402 "comment" => "The local users",
1404 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1405 "parent-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"],
1406 "comment" => "The parent user that has full control about this user"],
1407 "guid" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this user"],
1408 "username" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this user is known by"],
1409 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "encrypted password"],
1410 "legacy_password" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the password hash double-hashed?"],
1411 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "nick- and user name"],
1412 "email" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "the users email address"],
1413 "openid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1414 "timezone" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => "PHP-legal timezone"],
1415 "language" => ["type" => "varchar(32)", "not null" => "1", "default" => "en", "comment" => "default language"],
1416 "register_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of registration"],
1417 "login_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last login"],
1418 "default-location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Default for item.location"],
1419 "allow_location" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 allows to display the location"],
1420 "theme" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "user theme preference"],
1421 "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
1422 "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
1423 "spubkey" => ["type" => "text", "comment" => ""],
1424 "sprvkey" => ["type" => "text", "comment" => ""],
1425 "verified" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "user is verified through email"],
1426 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 for user is blocked"],
1427 "blockwall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to post to the profile page of the user"],
1428 "hidewall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide profile details from unkown viewers"],
1429 "blocktags" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to tag the post of this user"],
1430 "unkmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Permit unknown people to send private mails to this user"],
1431 "cntunkmail" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
1432 "notify-flags" => ["type" => "smallint unsigned", "not null" => "1", "default" => "65535", "comment" => "email notification options"],
1433 "page-flags" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "page/profile type"],
1434 "account-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1435 "prvnets" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1436 "pwdreset" => ["type" => "varchar(255)", "comment" => "Password reset request token"],
1437 "pwdreset_time" => ["type" => "datetime", "comment" => "Timestamp of the last password reset request"],
1438 "maxreq" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
1439 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1440 "account_removed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if 1 the account is removed"],
1441 "account_expired" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1442 "account_expires_on" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp when account expires and will be deleted"],
1443 "expire_notification_sent" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last warning of account expiration"],
1444 "def_gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1445 "allow_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1446 "allow_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1447 "deny_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1448 "deny_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1449 "openidserver" => ["type" => "text", "comment" => ""],
1452 "PRIMARY" => ["uid"],
1453 "nickname" => ["nickname(32)"],
1457 "comment" => "Deleted usernames",
1459 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1460 "username" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
1463 "PRIMARY" => ["id"],
1464 "username" => ["username(32)"],
1468 "comment" => "User specific public contact data",
1470 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["contact" => "id"], "comment" => "Contact id of the linked public contact"],
1471 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
1472 "blocked" => ["type" => "boolean", "comment" => "Contact is completely blocked for this user"],
1473 "ignored" => ["type" => "boolean", "comment" => "Posts from this contact are ignored"],
1474 "collapsed" => ["type" => "boolean", "comment" => "Posts from this contact are collapsed"]
1477 "PRIMARY" => ["uid", "cid"]
1481 "comment" => "User specific item data",
1483 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"], "comment" => "Item id"],
1484 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
1485 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide an item from the user"],
1486 "ignored" => ["type" => "boolean", "comment" => "Ignore this thread if set"],
1487 "pinned" => ["type" => "boolean", "comment" => "The item is pinned on the profile page"],
1488 "notification-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1491 "PRIMARY" => ["uid", "iid"],
1492 "uid_pinned" => ["uid", "pinned"],
1493 "iid_uid" => ["iid", "uid"]
1497 "comment" => "Activity Verbs",
1499 "id" => ["type" => "smallint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
1500 "name" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""]
1507 "comment" => "Inter process communication between the frontend and the worker",
1509 "key" => ["type" => "int", "not null" => "1", "primary" => "1", "comment" => ""],
1510 "jobs" => ["type" => "boolean", "comment" => "Flag for outstanding jobs"],
1513 "PRIMARY" => ["key"],
1515 "engine" => "MEMORY",
1518 "comment" => "Background tasks queue entries",
1520 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented worker task id"],
1521 "parameter" => ["type" => "mediumtext", "comment" => "Task command"],
1522 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Task priority"],
1523 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date"],
1524 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process id of the worker"],
1525 "executed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Execution date"],
1526 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1527 "retrial" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1528 "done" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marked 1 when the task was done - will be deleted later"],
1531 "PRIMARY" => ["id"],
1532 "done_parameter" => ["done", "parameter(64)"],
1533 "done_executed" => ["done", "executed"],
1534 "done_priority_created" => ["done", "priority", "created"],
1535 "done_priority_next_try" => ["done", "priority", "next_try"],
1536 "done_pid_next_try" => ["done", "pid", "next_try"],
1537 "done_pid_priority_created" => ["done", "pid", "priority", "created"]