3 /* Main database structure configuration file.
5 * Here are described all the tables, fields and indexes Friendica needs to work.
7 * Syntax (braces indicate optionale values):
9 * "comment" => "Description of the table",
12 * "type" => "<field type>{(<field size>)} <unsigned>",
14 * {"extra" => "auto_increment",}
15 * {"default" => "<default value>",}
16 * {"default" => NULL_DATE,} (for datetime fields)
18 * {"relation" => ["<foreign key table name>" => "<foreign key field name>"],}
19 * "comment" => "Description of the fields"
24 * "PRIMARY" => ["<primary key field name>", ...],
25 * "<index name>" => [{"UNIQUE",} "<field name>{(<key size>)}", ...]
30 * If you need to make any change, make sure to increment the DB_UPDATE_VERSION constant value below.
34 use Friendica\Database\DBA;
36 if (!defined('DB_UPDATE_VERSION')) {
37 define('DB_UPDATE_VERSION', 1317);
41 "2fa_recovery_codes" => [
42 "comment" => "Two-factor authentication recovery codes",
44 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User ID"],
45 "code" => ["type" => "varchar(50)", "not null" => "1", "primary" => "1", "comment" => "Recovery code string"],
46 "generated" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the code was generated"],
47 "used" => ["type" => "datetime", "comment" => "Datetime the code was used"],
50 "PRIMARY" => ["uid", "code"]
54 "comment" => "registered addons",
56 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
57 "name" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "addon base (file)name"],
58 "version" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "currently unused"],
59 "installed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently always 1"],
60 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently unused"],
61 "timestamp" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "file timestamp to check for reloads"],
62 "plugin_admin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = has admin config, 0 = has no admin config"],
66 "name" => ["UNIQUE", "name"],
70 "comment" => "ActivityPub compatible contacts - used in the ActivityPub implementation",
72 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URL of the contact"],
73 "uuid" => ["type" => "varchar(255)", "comment" => ""],
74 "type" => ["type" => "varchar(20)", "not null" => "1", "comment" => ""],
75 "following" => ["type" => "varchar(255)", "comment" => ""],
76 "followers" => ["type" => "varchar(255)", "comment" => ""],
77 "inbox" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
78 "outbox" => ["type" => "varchar(255)", "comment" => ""],
79 "sharedinbox" => ["type" => "varchar(255)", "comment" => ""],
80 "manually-approve" => ["type" => "boolean", "comment" => ""],
81 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
82 "name" => ["type" => "varchar(255)", "comment" => ""],
83 "about" => ["type" => "text", "comment" => ""],
84 "photo" => ["type" => "varchar(255)", "comment" => ""],
85 "addr" => ["type" => "varchar(255)", "comment" => ""],
86 "alias" => ["type" => "varchar(255)", "comment" => ""],
87 "pubkey" => ["type" => "text", "comment" => ""],
88 "baseurl" => ["type" => "varchar(255)", "comment" => "baseurl of the ap contact"],
89 "generator" => ["type" => "varchar(255)", "comment" => "Name of the contact's system"],
90 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
94 "addr" => ["addr(32)"],
95 "alias" => ["alias(190)"],
96 "url" => ["followers(190)"]
100 "comment" => "file attachments",
102 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "generated index"],
103 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
104 "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "hash"],
105 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "filename of original"],
106 "filetype" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "mimetype"],
107 "filesize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "size in bytes"],
108 "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"],
109 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
110 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
111 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>"],
112 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
113 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
114 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
115 "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
116 "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"],
123 "comment" => "OAuth usage",
125 "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""],
126 "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "relation" => ["clients" => "client_id"],
128 "redirect_uri" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
129 "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
130 "scope" => ["type" => "varchar(250)", "not null" => "1", "default" => "", "comment" => ""],
137 "comment" => "Stores temporary data",
139 "k" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "cache key"],
140 "v" => ["type" => "mediumtext", "comment" => "cached serialized value"],
141 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
142 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache insertion"],
146 "k_expires" => ["k", "expires"],
152 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
153 "challenge" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
154 "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
155 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
156 "type" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
157 "last_update" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
164 "comment" => "OAuth usage",
166 "client_id" => ["type" => "varchar(20)", "not null" => "1", "primary" => "1", "comment" => ""],
167 "pw" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => ""],
168 "redirect_uri" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
169 "name" => ["type" => "text", "comment" => ""],
170 "icon" => ["type" => "text", "comment" => ""],
171 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
174 "PRIMARY" => ["client_id"],
178 "comment" => "main configuration storage",
180 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
181 "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
182 "k" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
183 "v" => ["type" => "mediumtext", "comment" => ""],
187 "cat_k" => ["UNIQUE", "cat", "k"],
191 "comment" => "contact table",
193 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
194 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
195 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
196 "updated" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Date of last contact update"],
197 "self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if the contact is the user him/her self"],
198 "remote_self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
199 "rel" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "The kind of the relation between the user and the contact"],
200 "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
201 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network of the contact"],
202 "protocol" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Protocol of the contact"],
203 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"],
204 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"],
205 "location" => ["type" => "varchar(255)", "default" => "", "comment" => ""],
206 "about" => ["type" => "text", "comment" => ""],
207 "keywords" => ["type" => "text", "comment" => "public keywords (interests) of the contact"],
208 "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
209 "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
210 "attag" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
211 "avatar" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
212 "photo" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo of the contact"],
213 "thumb" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (thumb size)"],
214 "micro" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (micro size)"],
215 "site-pubkey" => ["type" => "text", "comment" => ""],
216 "issued-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
217 "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
218 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
219 "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
220 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
221 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
222 "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
223 "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
224 "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
225 "request" => ["type" => "varchar(255)", "comment" => ""],
226 "notify" => ["type" => "varchar(255)", "comment" => ""],
227 "poll" => ["type" => "varchar(255)", "comment" => ""],
228 "confirm" => ["type" => "varchar(255)", "comment" => ""],
229 "poco" => ["type" => "varchar(255)", "comment" => ""],
230 "aes_allow" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
231 "ret-aes" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
232 "usehub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
233 "subhub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
234 "hub-verify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
235 "last-update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last try to update the contact info"],
236 "success_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful contact update"],
237 "failure_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed update"],
238 "name-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
239 "uri-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
240 "avatar-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
241 "term-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
242 "last-item" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "date of the last post"],
243 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
244 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "Node-wide block status"],
245 "block_reason" => ["type" => "text", "comment" => "Node-wide block reason"],
246 "readonly" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "posts of the contact are readonly"],
247 "writable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
248 "forum" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a forum"],
249 "prv" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a private group"],
250 "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
251 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
252 "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
253 "pending" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
254 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact has been deleted"],
255 "rating" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
256 "unsearchable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact prefers to not be searchable"],
257 "sensitive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact posts sensitive content"],
258 "baseurl" => ["type" => "varchar(255)", "default" => "", "comment" => "baseurl of the contact"],
259 "reason" => ["type" => "text", "comment" => ""],
260 "closeness" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "99", "comment" => ""],
261 "info" => ["type" => "mediumtext", "comment" => ""],
262 "profile-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
263 "bdyear" => ["type" => "varchar(4)", "not null" => "1", "default" => "", "comment" => ""],
264 "bd" => ["type" => "date", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""],
265 "notify_new_posts" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
266 "fetch_further_information" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
267 "ffi_keyword_blacklist" => ["type" => "text", "comment" => ""],
271 "uid_name" => ["uid", "name(190)"],
272 "self_uid" => ["self", "uid"],
273 "alias_uid" => ["alias(32)", "uid"],
274 "pending_uid" => ["pending", "uid"],
275 "blocked_uid" => ["blocked", "uid"],
276 "uid_rel_network_poll" => ["uid", "rel", "network", "poll(64)", "archive"],
277 "uid_network_batch" => ["uid", "network", "batch(64)"],
278 "addr_uid" => ["addr(32)", "uid"],
279 "nurl_uid" => ["nurl(32)", "uid"],
280 "nick_uid" => ["nick(32)", "uid"],
281 "dfrn-id" => ["dfrn-id(64)"],
282 "issued-id" => ["issued-id(64)"],
286 "comment" => "private messages",
288 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
289 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this conversation"],
290 "recips" => ["type" => "text", "comment" => "sender_handle;recipient_handle"],
291 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
292 "creator" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "handle of creator"],
293 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation timestamp"],
294 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "edited timestamp"],
295 "subject" => ["type" => "text", "comment" => "subject of initial message"],
303 "comment" => "Raw data and structure information for messages",
305 "item-uri" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "Original URI of the item - unrelated to the table with the same name"],
306 "reply-to-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "URI to which this item is a reply"],
307 "conversation-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation URI"],
308 "conversation-href" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation link"],
309 "protocol" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "255", "comment" => "The protocol of the item"],
310 "source" => ["type" => "mediumtext", "comment" => "Original source"],
311 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Receiving date"],
314 "PRIMARY" => ["item-uri"],
315 "conversation-uri" => ["conversation-uri"],
316 "received" => ["received"],
319 "diaspora-interaction" => [
320 "comment" => "Signed Diaspora Interaction",
322 "uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
323 "interaction" => ["type" => "mediumtext", "comment" => "The Diaspora interaction"]
326 "PRIMARY" => ["uri-id"]
330 "comment" => "Events",
332 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
333 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
334 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
335 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact_id (ID of the contact in contact table)"],
336 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
337 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
338 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
339 "start" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event start time"],
340 "finish" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event end time"],
341 "summary" => ["type" => "text", "comment" => "short description or title of the event"],
342 "desc" => ["type" => "text", "comment" => "event description"],
343 "location" => ["type" => "text", "comment" => "event location"],
344 "type" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => "event or birthday"],
345 "nofinish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if event does have no end this is 1"],
346 "adjust" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "adjust to timezone of the recipient (0 or 1)"],
347 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "0 or 1"],
348 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
349 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
350 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
351 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
355 "uid_start" => ["uid", "start"],
359 "comment" => "Diaspora compatible contacts - used in the Diaspora implementation",
361 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
362 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "unique id"],
363 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
364 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
365 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
366 "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
367 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
368 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
369 "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
370 "notify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
371 "poll" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
372 "confirm" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
373 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
374 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
375 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
376 "pubkey" => ["type" => "text", "comment" => ""],
377 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
381 "addr" => ["addr(32)"],
382 "url" => ["UNIQUE", "url(190)"],
386 "comment" => "friend suggestion stuff",
388 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
389 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
390 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
391 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
392 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
393 "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
394 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
395 "note" => ["type" => "text", "comment" => ""],
396 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
403 "comment" => "contacts ignored by friend suggestions",
405 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
406 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Local User id"],
407 "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => "gcontact.id of ignored contact"],
416 "comment" => "global contacts",
418 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
419 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"],
420 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"],
421 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the contacts profile page"],
422 "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
423 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the profile photo"],
424 "connect" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
425 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
426 "updated" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
427 "last_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
428 "last_failure" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
429 "archive_date" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
430 "archived" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
431 "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
432 "about" => ["type" => "text", "comment" => ""],
433 "keywords" => ["type" => "text", "comment" => "puplic keywords (interests)"],
434 "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
435 "birthday" => ["type" => "varchar(32)", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""],
436 "community" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if contact is forum account"],
437 "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "-1", "comment" => ""],
438 "hide" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = should be hidden from search"],
439 "nsfw" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = contact posts nsfw content"],
440 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "social network protocol"],
441 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
442 "notify" => ["type" => "varchar(255)", "comment" => ""],
443 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
444 "generation" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
445 "server_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "baseurl of the contacts server"],
449 "nurl" => ["UNIQUE", "nurl(190)"],
450 "name" => ["name(64)"],
451 "nick" => ["nick(32)"],
452 "addr" => ["addr(64)"],
453 "hide_network_updated" => ["hide", "network", "updated"],
454 "updated" => ["updated"],
458 "comment" => "'friends of friends' linkages derived from poco",
460 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
461 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
462 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
463 "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
464 "zcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
465 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
469 "cid_uid_gcid_zcid" => ["UNIQUE", "cid", "uid", "gcid", "zcid"],
474 "comment" => "privacy groups, group info",
476 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
477 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
478 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the member list is not private"],
479 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the group has been deleted"],
480 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "human readable name of group"],
488 "comment" => "privacy groups, member info",
490 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
491 "gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["group" => "id"], "comment" => "groups.id of the associated group"],
492 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id of the member assigned to the associated group"],
496 "contactid" => ["contact-id"],
497 "gid_contactid" => ["UNIQUE", "gid", "contact-id"],
501 "comment" => "Global servers",
503 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
504 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
505 "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
506 "version" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
507 "site_name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
508 "info" => ["type" => "text", "comment" => ""],
509 "register_policy" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
510 "registered-users" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Number of registered users"],
511 "poco" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
512 "noscrape" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
513 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
514 "platform" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
515 "relay-subscribe" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Has the server subscribed to the relay system"],
516 "relay-scope" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => "The scope of messages that the server wants to get"],
517 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
518 "last_poco_query" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
519 "last_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
520 "last_failure" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
524 "nurl" => ["UNIQUE", "nurl(190)"],
528 "comment" => "Tags that the server has subscribed",
530 "gserver-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gserver" => "id"], "primary" => "1",
531 "comment" => "The id of the gserver"],
532 "tag" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "primary" => "1", "comment" => "Tag that the server has subscribed"],
535 "PRIMARY" => ["gserver-id", "tag"],
540 "comment" => "addon hook registry",
542 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
543 "hook" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => "name of hook"],
544 "file" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "relative filename of hook handler"],
545 "function" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "function name of hook handler"],
546 "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"],
550 "hook_file_function" => ["UNIQUE", "hook", "file", "function"],
554 "comment" => "Status of ActivityPub inboxes",
556 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URL of the inbox"],
557 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date of this entry"],
558 "success" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful delivery"],
559 "failure" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed delivery"],
560 "previous" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Previous delivery date"],
561 "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the inbox archived?"],
562 "shared" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is it a shared inbox?"]
571 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
572 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
573 "fid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["fcontact" => "id"], "comment" => ""],
574 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
575 "knowyou" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
576 "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
577 "note" => ["type" => "text", "comment" => ""],
578 "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
579 "datetime" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
580 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
581 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
588 "comment" => "Structure for all posts",
590 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
591 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this item"],
592 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
593 "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
594 "uri-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
595 "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"],
596 "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "uri of the parent to this item"],
597 "parent-uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the parent uri"],
598 "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"],
599 "thr-parent-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"],
600 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation timestamp."],
601 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last edit (default is created)"],
602 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last comment/reply to this item"],
603 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime"],
604 "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"],
605 "gravity" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
606 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network from where the item comes from"],
607 "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"],
608 "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"],
609 "icid" => ["type" => "int unsigned", "relation" => ["item-content" => "id"], "comment" => "Id of the item-content table entry that contains the whole item content"],
610 "iaid" => ["type" => "int unsigned", "relation" => ["item-activity" => "id"], "comment" => "Id of the item-activity table entry that contains the activity data"],
611 "extid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
612 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"],
613 "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
614 "private" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "distribution is restricted"],
615 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
616 "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
617 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been deleted"],
618 // User specific fields. Eventually they will move to user-item
619 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
620 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
621 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "This item was posted to the wall of uid"],
622 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item originated at this site"],
623 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
624 "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been favourited"],
625 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "item has not been seen"],
626 "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "The owner of this item was mentioned in it"],
627 "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
628 "psid" => ["type" => "int unsigned", "relation" => ["permissionset" => "id"], "comment" => "ID of the permission set of this post"],
629 // It has to be decided whether these fields belong to the user or the structure
630 "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"],
631 "event-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["event" => "id"], "comment" => "Used to link to the event.id"],
632 // Could possibly be replaced by the "attach" table?
633 "attach" => ["type" => "mediumtext", "comment" => "JSON structure representing attachments to this item"],
634 // Deprecated fields. Will be removed in upcoming versions
635 "allow_cid" => ["type" => "mediumtext", "comment" => "Deprecated"],
636 "allow_gid" => ["type" => "mediumtext", "comment" => "Deprecated"],
637 "deny_cid" => ["type" => "mediumtext", "comment" => "Deprecated"],
638 "deny_gid" => ["type" => "mediumtext", "comment" => "Deprecated"],
639 "postopts" => ["type" => "text", "comment" => "Deprecated"],
640 "inform" => ["type" => "mediumtext", "comment" => "Deprecated"],
641 "type" => ["type" => "varchar(20)", "comment" => "Deprecated"],
642 "bookmark" => ["type" => "boolean", "comment" => "Deprecated"],
643 "file" => ["type" => "mediumtext", "comment" => "Deprecated"],
644 "location" => ["type" => "varchar(255)", "comment" => "Deprecated"],
645 "coord" => ["type" => "varchar(255)", "comment" => "Deprecated"],
646 "tag" => ["type" => "mediumtext", "comment" => "Deprecated"],
647 "plink" => ["type" => "varchar(255)", "comment" => "Deprecated"],
648 "title" => ["type" => "varchar(255)", "comment" => "Deprecated"],
649 "content-warning" => ["type" => "varchar(255)", "comment" => "Deprecated"],
650 "body" => ["type" => "mediumtext", "comment" => "Deprecated"],
651 "app" => ["type" => "varchar(255)", "comment" => "Deprecated"],
652 "verb" => ["type" => "varchar(100)", "comment" => "Deprecated"],
653 "object-type" => ["type" => "varchar(100)", "comment" => "Deprecated"],
654 "object" => ["type" => "text", "comment" => "Deprecated"],
655 "target-type" => ["type" => "varchar(100)", "comment" => "Deprecated"],
656 "target" => ["type" => "text", "comment" => "Deprecated"],
657 "author-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
658 "author-link" => ["type" => "varchar(255)", "comment" => "Deprecated"],
659 "author-avatar" => ["type" => "varchar(255)", "comment" => "Deprecated"],
660 "owner-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
661 "owner-link" => ["type" => "varchar(255)", "comment" => "Deprecated"],
662 "owner-avatar" => ["type" => "varchar(255)", "comment" => "Deprecated"],
663 "rendered-hash" => ["type" => "varchar(32)", "comment" => "Deprecated"],
664 "rendered-html" => ["type" => "mediumtext", "comment" => "Deprecated"],
668 "guid" => ["guid(191)"],
669 "uri" => ["uri(191)"],
670 "parent" => ["parent"],
671 "parent-uri" => ["parent-uri(191)"],
672 "extid" => ["extid(191)"],
673 "uid_id" => ["uid", "id"],
674 "uid_contactid_id" => ["uid", "contact-id", "id"],
675 "uid_received" => ["uid", "received"],
676 "uid_commented" => ["uid", "commented"],
677 "uid_unseen_contactid" => ["uid", "unseen", "contact-id"],
678 "uid_network_received" => ["uid", "network", "received"],
679 "uid_network_commented" => ["uid", "network", "commented"],
680 "uid_thrparent" => ["uid", "thr-parent(190)"],
681 "uid_parenturi" => ["uid", "parent-uri(190)"],
682 "uid_contactid_received" => ["uid", "contact-id", "received"],
683 "authorid_received" => ["author-id", "received"],
684 "ownerid" => ["owner-id"],
685 "contact-id" => ["contact-id"],
686 "uid_uri" => ["uid", "uri(190)"],
687 "resource-id" => ["resource-id"],
688 "deleted_changed" => ["deleted", "changed"],
689 "uid_wall_changed" => ["uid", "wall", "changed"],
690 "uid_eventid" => ["uid", "event-id"],
693 "psid_wall" => ["psid", "wall"],
697 "comment" => "Activities for items",
699 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
700 "uri" => ["type" => "varchar(255)", "comment" => ""],
701 "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
702 "uri-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
703 "activity" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""]
707 "uri-hash" => ["UNIQUE", "uri-hash"],
708 "uri" => ["uri(191)"],
709 "uri-id" => ["uri-id"]
713 "comment" => "Content for all posts",
715 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
716 "uri" => ["type" => "varchar(255)", "comment" => ""],
717 "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
718 "uri-plink-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
719 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "item title"],
720 "content-warning" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
721 "body" => ["type" => "mediumtext", "comment" => "item body content"],
722 "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "text location where this item originated"],
723 "coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "longitude/latitude pair representing location where this item originated"],
724 "language" => ["type" => "text", "comment" => "Language information about this post"],
725 "app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "application which generated this item"],
726 "rendered-hash" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
727 "rendered-html" => ["type" => "mediumtext", "comment" => "item.body converted to html"],
728 "object-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams object type"],
729 "object" => ["type" => "text", "comment" => "JSON encoded object structure unless it is an implied object (normal post)"],
730 "target-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams target type if applicable (URI)"],
731 "target" => ["type" => "text", "comment" => "JSON encoded target structure if used"],
732 "plink" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "permalink or URL to a displayable copy of the message at its source"],
733 "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams verb"]
737 "uri-plink-hash" => ["UNIQUE", "uri-plink-hash"],
738 "uri" => ["uri(191)"],
739 "uri-id" => ["uri-id"]
742 "item-delivery-data" => [
743 "comment" => "Delivery data for items",
745 "iid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["item" => "id"], "comment" => "Item id"],
746 "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"],
747 "inform" => ["type" => "mediumtext", "comment" => "Additional receivers of the linked item"],
748 "queue_count" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Initial number of delivery recipients, used as item.delivery_queue_count"],
749 "queue_done" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries, used as item.delivery_queue_done"],
750 "activitypub" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via ActivityPub"],
751 "dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via DFRN"],
752 "legacy_dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via legacy DFRN"],
753 "diaspora" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via Diaspora"],
754 "ostatus" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via OStatus"],
757 "PRIMARY" => ["iid"],
761 "comment" => "URI and GUID for items",
763 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
764 "uri" => ["type" => "varbinary(255)", "not null" => "1", "comment" => "URI of an item"],
765 "guid" => ["type" => "varbinary(255)", "comment" => "A unique identifier for an item"]
769 "uri" => ["UNIQUE", "uri"],
776 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
777 "name" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => ""],
778 "locked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
779 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process ID"],
780 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
784 "name_expires" => ["name", "expires"]
788 "comment" => "private messages",
790 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
791 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
792 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this private message"],
793 "from-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "name of the sender"],
794 "from-photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "contact photo link of the sender"],
795 "from-url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "profile linke of the sender"],
796 "contact-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "relation" => ["contact" => "id"], "comment" => "contact.id"],
797 "convid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["conv" => "id"], "comment" => "conv.id"],
798 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
799 "body" => ["type" => "mediumtext", "comment" => ""],
800 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if message visited it is 1"],
801 "reply" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
802 "replied" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
803 "unknown" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if sender not in the contact table this is 1"],
804 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
805 "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
806 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time of the private message"],
810 "uid_seen" => ["uid", "seen"],
811 "convid" => ["convid"],
812 "uri" => ["uri(64)"],
813 "parent-uri" => ["parent-uri(64)"],
814 "contactid" => ["contact-id(32)"],
818 "comment" => "Mail account data for fetching mails",
820 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
821 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
822 "server" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
823 "port" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
824 "ssltype" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
825 "mailbox" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
826 "user" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
827 "pass" => ["type" => "text", "comment" => ""],
828 "reply_to" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
829 "action" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
830 "movetofolder" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
831 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
832 "last_check" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
839 "comment" => "table of accounts that can manage each other",
841 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
842 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
843 "mid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
847 "uid_mid" => ["UNIQUE", "uid", "mid"],
851 "comment" => "notifications",
853 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
854 "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => ""],
855 "type" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
856 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
857 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
858 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
859 "date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
860 "msg" => ["type" => "mediumtext", "comment" => ""],
861 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
862 "link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
863 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id"],
864 "parent" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
865 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
866 "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""],
867 "otype" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => ""],
868 "name_cache" => ["type" => "tinytext", "comment" => "Cached bbcode parsing of name"],
869 "msg_cache" => ["type" => "mediumtext", "comment" => "Cached bbcode parsing of msg"]
873 "hash_uid" => ["hash", "uid"],
874 "seen_uid_date" => ["seen", "uid", "date"],
875 "uid_date" => ["uid", "date"],
876 "uid_type_link" => ["uid", "type", "link(190)"],
879 "notify-threads" => [
882 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
883 "notify-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["notify" => "id"], "comment" => ""],
884 "master-parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"],
886 "parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
887 "receiver-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"],
888 "comment" => "User id"],
895 "comment" => "cache for OEmbed queries",
897 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
898 "maxwidth" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "comment" => "Maximum width passed to Oembed"],
899 "content" => ["type" => "mediumtext", "comment" => "OEmbed data of the page"],
900 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
903 "PRIMARY" => ["url", "maxwidth"],
904 "created" => ["created"],
907 "openwebauth-token" => [
908 "comment" => "Store OpenWebAuth token to verify contacts",
910 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
911 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
912 "type" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Verify type"],
913 "token" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A generated token"],
914 "meta" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
915 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
922 "comment" => "cache for 'parse_url' queries",
924 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
925 "guessing" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the 'guessing' mode active?"],
926 "oembed" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the data the result of oembed?"],
927 "content" => ["type" => "mediumtext", "comment" => "page data"],
928 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
931 "PRIMARY" => ["url", "guessing", "oembed"],
932 "created" => ["created"],
936 "comment" => "Storage for participation messages from Diaspora",
938 "iid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["item" => "id"], "comment" => ""],
939 "server" => ["type" => "varchar(60)", "not null" => "1", "primary" => "1", "comment" => ""],
940 "cid" => ["type" => "int unsigned", "not null" => "1", "relation" => ["contact" => "id"], "comment" => ""],
941 "fid" => ["type" => "int unsigned", "not null" => "1", "relation" => ["fcontact" => "id"], "comment" => ""],
944 "PRIMARY" => ["iid", "server"],
950 "comment" => "personal (per user) configuration storage",
952 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
953 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
954 "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
955 "k" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => ""],
956 "v" => ["type" => "mediumtext", "comment" => ""],
960 "uid_cat_k" => ["UNIQUE", "uid", "cat", "k"],
966 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
967 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner id of this permission set"],
968 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
969 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
970 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
971 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
975 "uid_allow_cid_allow_gid_deny_cid_deny_gid" => ["allow_cid(50)", "allow_gid(30)", "deny_cid(50)", "deny_gid(30)"],
979 "comment" => "photo storage",
981 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
982 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
983 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
984 "guid" => ["type" => "char(16)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this photo"],
985 "resource-id" => ["type" => "char(32)", "not null" => "1", "default" => "", "comment" => ""],
986 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation date"],
987 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edited date"],
988 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
989 "desc" => ["type" => "text", "comment" => ""],
990 "album" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "The name of the album to which the photo belongs"],
991 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
992 "type" => ["type" => "varchar(30)", "not null" => "1", "default" => "image/jpeg"],
993 "height" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
994 "width" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
995 "datasize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
996 "data" => ["type" => "mediumblob", "not null" => "1", "comment" => ""],
997 "scale" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
998 "profile" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
999 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
1000 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
1001 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
1002 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
1003 "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
1004 "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"],
1005 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
1008 "PRIMARY" => ["id"],
1009 "contactid" => ["contact-id"],
1010 "uid_contactid" => ["uid", "contact-id"],
1011 "uid_profile" => ["uid", "profile"],
1012 "uid_album_scale_created" => ["uid", "album(32)", "scale", "created"],
1013 "uid_album_resource-id_created" => ["uid", "album(32)", "resource-id", "created"],
1014 "resource-id" => ["resource-id"],
1018 "comment" => "Currently unused table for storing poll results",
1020 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
1021 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1022 "q0" => ["type" => "text", "comment" => ""],
1023 "q1" => ["type" => "text", "comment" => ""],
1024 "q2" => ["type" => "text", "comment" => ""],
1025 "q3" => ["type" => "text", "comment" => ""],
1026 "q4" => ["type" => "text", "comment" => ""],
1027 "q5" => ["type" => "text", "comment" => ""],
1028 "q6" => ["type" => "text", "comment" => ""],
1029 "q7" => ["type" => "text", "comment" => ""],
1030 "q8" => ["type" => "text", "comment" => ""],
1031 "q9" => ["type" => "text", "comment" => ""],
1034 "PRIMARY" => ["id"],
1039 "comment" => "data for polls - currently unused",
1041 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1042 "poll_id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["poll" => "id"]],
1043 "choice" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1046 "PRIMARY" => ["id"],
1047 "poll_id" => ["poll_id"],
1051 "comment" => "Currently running system processes",
1053 "pid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "comment" => ""],
1054 "command" => ["type" => "varbinary(32)", "not null" => "1", "default" => "", "comment" => ""],
1055 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1058 "PRIMARY" => ["pid"],
1059 "command" => ["command"],
1063 "comment" => "user profiles data",
1065 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1066 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
1067 "profile-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name of the profile"],
1068 "is-default" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Mark this profile as default profile"],
1069 "hide-friends" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide friend list from viewers of this profile"],
1070 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1071 "pdesc" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Title or description"],
1072 "dob" => ["type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00", "comment" => "Day of birth"],
1073 "address" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1074 "locality" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1075 "region" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1076 "postal-code" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1077 "country-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1078 "hometown" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1079 "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1080 "marital" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1081 "with" => ["type" => "text", "comment" => ""],
1082 "howlong" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1083 "sexual" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1084 "politic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1085 "religion" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1086 "pub_keywords" => ["type" => "text", "comment" => ""],
1087 "prv_keywords" => ["type" => "text", "comment" => ""],
1088 "likes" => ["type" => "text", "comment" => ""],
1089 "dislikes" => ["type" => "text", "comment" => ""],
1090 "about" => ["type" => "text", "comment" => ""],
1091 "summary" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1092 "music" => ["type" => "text", "comment" => ""],
1093 "book" => ["type" => "text", "comment" => ""],
1094 "tv" => ["type" => "text", "comment" => ""],
1095 "film" => ["type" => "text", "comment" => ""],
1096 "interest" => ["type" => "text", "comment" => ""],
1097 "romance" => ["type" => "text", "comment" => ""],
1098 "work" => ["type" => "text", "comment" => ""],
1099 "education" => ["type" => "text", "comment" => ""],
1100 "contact" => ["type" => "text", "comment" => ""],
1101 "homepage" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1102 "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1103 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1104 "thumb" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1105 "publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish default profile in local directory"],
1106 "net-publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish profile in global directory"],
1109 "PRIMARY" => ["id"],
1110 "uid_is-default" => ["uid", "is-default"],
1111 "pub_keywords" => ["FULLTEXT", "pub_keywords"],
1114 "profile_check" => [
1115 "comment" => "DFRN remote auth use",
1117 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1118 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1119 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
1120 "dfrn_id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1121 "sec" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1122 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1125 "PRIMARY" => ["id"],
1128 "push_subscriber" => [
1129 "comment" => "Used for OStatus: Contains feed subscribers",
1131 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1132 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1133 "callback_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1134 "topic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1135 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1136 "push" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1137 "last_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last successful trial"],
1138 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1139 "renewed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last subscription renewal"],
1140 "secret" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1143 "PRIMARY" => ["id"],
1144 "next_try" => ["next_try"],
1148 "comment" => "registrations requiring admin approval",
1150 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1151 "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1152 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1153 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1154 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1155 "language" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
1156 "note" => ["type" => "text", "comment" => ""],
1159 "PRIMARY" => ["id"],
1165 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1166 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1167 "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1170 "PRIMARY" => ["id"],
1175 "comment" => "web session storage",
1177 "id" => ["type" => "bigint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1178 "sid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
1179 "data" => ["type" => "text", "comment" => ""],
1180 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1183 "PRIMARY" => ["id"],
1184 "sid" => ["sid(64)"],
1185 "expire" => ["expire"],
1189 "comment" => "Diaspora signatures",
1191 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1192 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id"],
1193 "signed_text" => ["type" => "mediumtext", "comment" => ""],
1194 "signature" => ["type" => "text", "comment" => ""],
1195 "signer" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1198 "PRIMARY" => ["id"],
1199 "iid" => ["UNIQUE", "iid"],
1203 "comment" => "item taxonomy (categories, tags, etc.) table",
1205 "tid" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
1206 "oid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
1207 "otype" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1208 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1209 "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1210 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1211 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1212 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1213 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1214 "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1215 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1218 "PRIMARY" => ["tid"],
1219 "term_type" => ["term(64)", "type"],
1220 "oid_otype_type_term" => ["oid", "otype", "type", "term(32)"],
1221 "uid_otype_type_term_global_created" => ["uid", "otype", "type", "term(32)", "global", "created"],
1222 "uid_otype_type_url" => ["uid", "otype", "type", "url(64)"],
1223 "guid" => ["guid(64)"],
1227 "comment" => "Thread related data",
1229 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"],
1230 "comment" => "sequential ID"],
1231 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1232 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
1233 "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item owner"],
1234 "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item author"],
1235 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1236 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1237 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1238 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1239 "changed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1240 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1241 "private" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1242 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1243 "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1244 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1245 "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1246 "ignored" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1247 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"],
1248 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
1249 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1250 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1251 "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1252 "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1253 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
1254 "bookmark" => ["type" => "boolean", "comment" => ""],
1257 "PRIMARY" => ["iid"],
1258 "uid_network_commented" => ["uid", "network", "commented"],
1259 "uid_network_received" => ["uid", "network", "received"],
1260 "uid_contactid_commented" => ["uid", "contact-id", "commented"],
1261 "uid_contactid_received" => ["uid", "contact-id", "received"],
1262 "contactid" => ["contact-id"],
1263 "ownerid" => ["owner-id"],
1264 "authorid" => ["author-id"],
1265 "uid_received" => ["uid", "received"],
1266 "uid_commented" => ["uid", "commented"],
1267 "uid_wall_received" => ["uid", "wall", "received"],
1268 "private_wall_origin_commented" => ["private", "wall", "origin", "commented"],
1272 "comment" => "OAuth usage",
1274 "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""],
1275 "secret" => ["type" => "text", "comment" => ""],
1276 "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "relation" => ["clients" => "client_id"]],
1277 "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
1278 "scope" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
1279 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1282 "PRIMARY" => ["id"],
1286 "comment" => "The local users",
1288 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1289 "parent-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"],
1290 "comment" => "The parent user that has full control about this user"],
1291 "guid" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this user"],
1292 "username" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this user is known by"],
1293 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "encrypted password"],
1294 "legacy_password" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the password hash double-hashed?"],
1295 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "nick- and user name"],
1296 "email" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "the users email address"],
1297 "openid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1298 "timezone" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => "PHP-legal timezone"],
1299 "language" => ["type" => "varchar(32)", "not null" => "1", "default" => "en", "comment" => "default language"],
1300 "register_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of registration"],
1301 "login_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last login"],
1302 "default-location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Default for item.location"],
1303 "allow_location" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 allows to display the location"],
1304 "theme" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "user theme preference"],
1305 "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
1306 "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
1307 "spubkey" => ["type" => "text", "comment" => ""],
1308 "sprvkey" => ["type" => "text", "comment" => ""],
1309 "verified" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "user is verified through email"],
1310 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 for user is blocked"],
1311 "blockwall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to post to the profile page of the user"],
1312 "hidewall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide profile details from unkown viewers"],
1313 "blocktags" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to tag the post of this user"],
1314 "unkmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Permit unknown people to send private mails to this user"],
1315 "cntunkmail" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
1316 "notify-flags" => ["type" => "smallint unsigned", "not null" => "1", "default" => "65535", "comment" => "email notification options"],
1317 "page-flags" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "page/profile type"],
1318 "account-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1319 "prvnets" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1320 "pwdreset" => ["type" => "varchar(255)", "comment" => "Password reset request token"],
1321 "pwdreset_time" => ["type" => "datetime", "comment" => "Timestamp of the last password reset request"],
1322 "maxreq" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
1323 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1324 "account_removed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if 1 the account is removed"],
1325 "account_expired" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1326 "account_expires_on" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp when account expires and will be deleted"],
1327 "expire_notification_sent" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last warning of account expiration"],
1328 "def_gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1329 "allow_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1330 "allow_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1331 "deny_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1332 "deny_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1333 "openidserver" => ["type" => "text", "comment" => ""],
1336 "PRIMARY" => ["uid"],
1337 "nickname" => ["nickname(32)"],
1341 "comment" => "Deleted usernames",
1343 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1344 "username" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
1347 "PRIMARY" => ["id"],
1348 "username" => ["username(32)"],
1352 "comment" => "User specific public contact data",
1354 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["contact" => "id"], "comment" => "Contact id of the linked public contact"],
1355 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
1356 "blocked" => ["type" => "boolean", "comment" => "Contact is completely blocked for this user"],
1357 "ignored" => ["type" => "boolean", "comment" => "Posts from this contact are ignored"],
1358 "collapsed" => ["type" => "boolean", "comment" => "Posts from this contact are collapsed"]
1361 "PRIMARY" => ["uid", "cid"]
1365 "comment" => "User specific item data",
1367 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"], "comment" => "Item id"],
1368 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
1369 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide an item from the user"],
1370 "ignored" => ["type" => "boolean", "comment" => "Ignore this thread if set"]
1373 "PRIMARY" => ["uid", "iid"]
1377 "comment" => "Inter process communication between the frontend and the worker",
1379 "key" => ["type" => "int", "not null" => "1", "primary" => "1", "comment" => ""],
1380 "jobs" => ["type" => "boolean", "comment" => "Flag for outstanding jobs"],
1383 "PRIMARY" => ["key"],
1385 "engine" => "MEMORY",
1388 "comment" => "Background tasks queue entries",
1390 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented worker task id"],
1391 "parameter" => ["type" => "mediumtext", "comment" => "Task command"],
1392 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Task priority"],
1393 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date"],
1394 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process id of the worker"],
1395 "executed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Execution date"],
1396 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1397 "retrial" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1398 "done" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marked 1 when the task was done - will be deleted later"],
1401 "PRIMARY" => ["id"],
1402 "done_parameter" => ["done", "parameter(64)"],
1403 "done_executed" => ["done", "executed"],
1404 "done_priority_created" => ["done", "priority", "created"],
1405 "done_priority_next_try" => ["done", "priority", "next_try"],
1406 "done_pid_next_try" => ["done", "pid", "next_try"],
1407 "done_pid_priority_created" => ["done", "pid", "priority", "created"]
1411 "comment" => "Data stored by Database storage backend",
1413 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented image data id"],
1414 "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"]