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', 1329);
41 "2fa_app_specific_password" => [
42 "comment" => "Two-factor app-specific _password",
44 "id" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Password ID for revocation"],
45 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "relation" => ["user" => "uid"], "comment" => "User ID"],
46 "description" => ["type" => "varchar(255)", "comment" => "Description of the usage of the password"],
47 "hashed_password" => ["type" => "varchar(255)", "not null" => "1", "comment" => "Hashed password"],
48 "generated" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the password was generated"],
49 "last_used" => ["type" => "datetime", "comment" => "Datetime the password was last used"],
53 "uid_description" => ["uid", "description(190)"],
56 "2fa_recovery_codes" => [
57 "comment" => "Two-factor authentication recovery codes",
59 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User ID"],
60 "code" => ["type" => "varchar(50)", "not null" => "1", "primary" => "1", "comment" => "Recovery code string"],
61 "generated" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the code was generated"],
62 "used" => ["type" => "datetime", "comment" => "Datetime the code was used"],
65 "PRIMARY" => ["uid", "code"]
69 "comment" => "registered addons",
71 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
72 "name" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "addon base (file)name"],
73 "version" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "currently unused"],
74 "installed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently always 1"],
75 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently unused"],
76 "timestamp" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "file timestamp to check for reloads"],
77 "plugin_admin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = has admin config, 0 = has no admin config"],
81 "name" => ["UNIQUE", "name"],
85 "comment" => "ActivityPub compatible contacts - used in the ActivityPub implementation",
87 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URL of the contact"],
88 "uuid" => ["type" => "varchar(255)", "comment" => ""],
89 "type" => ["type" => "varchar(20)", "not null" => "1", "comment" => ""],
90 "following" => ["type" => "varchar(255)", "comment" => ""],
91 "followers" => ["type" => "varchar(255)", "comment" => ""],
92 "inbox" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
93 "outbox" => ["type" => "varchar(255)", "comment" => ""],
94 "sharedinbox" => ["type" => "varchar(255)", "comment" => ""],
95 "manually-approve" => ["type" => "boolean", "comment" => ""],
96 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
97 "name" => ["type" => "varchar(255)", "comment" => ""],
98 "about" => ["type" => "text", "comment" => ""],
99 "photo" => ["type" => "varchar(255)", "comment" => ""],
100 "addr" => ["type" => "varchar(255)", "comment" => ""],
101 "alias" => ["type" => "varchar(255)", "comment" => ""],
102 "pubkey" => ["type" => "text", "comment" => ""],
103 "baseurl" => ["type" => "varchar(255)", "comment" => "baseurl of the ap contact"],
104 "generator" => ["type" => "varchar(255)", "comment" => "Name of the contact's system"],
105 "following_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of following contacts"],
106 "followers_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of followers"],
107 "statuses_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of posts"],
108 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
111 "PRIMARY" => ["url"],
112 "addr" => ["addr(32)"],
113 "alias" => ["alias(190)"],
114 "url" => ["followers(190)"]
118 "comment" => "file attachments",
120 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "generated index"],
121 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
122 "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "hash"],
123 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "filename of original"],
124 "filetype" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "mimetype"],
125 "filesize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "size in bytes"],
126 "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"],
127 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
128 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
129 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>"],
130 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
131 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
132 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
133 "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
134 "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"],
141 "comment" => "OAuth usage",
143 "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""],
144 "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "relation" => ["clients" => "client_id"],
146 "redirect_uri" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
147 "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
148 "scope" => ["type" => "varchar(250)", "not null" => "1", "default" => "", "comment" => ""],
155 "comment" => "Stores temporary data",
157 "k" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "cache key"],
158 "v" => ["type" => "mediumtext", "comment" => "cached serialized value"],
159 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
160 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache insertion"],
164 "k_expires" => ["k", "expires"],
170 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
171 "challenge" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
172 "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
173 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
174 "type" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
175 "last_update" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
182 "comment" => "OAuth usage",
184 "client_id" => ["type" => "varchar(20)", "not null" => "1", "primary" => "1", "comment" => ""],
185 "pw" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => ""],
186 "redirect_uri" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
187 "name" => ["type" => "text", "comment" => ""],
188 "icon" => ["type" => "text", "comment" => ""],
189 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
192 "PRIMARY" => ["client_id"],
196 "comment" => "main configuration storage",
198 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
199 "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
200 "k" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
201 "v" => ["type" => "mediumtext", "comment" => ""],
205 "cat_k" => ["UNIQUE", "cat", "k"],
209 "comment" => "contact table",
211 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
212 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
213 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
214 "updated" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Date of last contact update"],
215 "self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if the contact is the user him/her self"],
216 "remote_self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
217 "rel" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "The kind of the relation between the user and the contact"],
218 "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
219 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network of the contact"],
220 "protocol" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Protocol of the contact"],
221 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"],
222 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"],
223 "location" => ["type" => "varchar(255)", "default" => "", "comment" => ""],
224 "about" => ["type" => "text", "comment" => ""],
225 "keywords" => ["type" => "text", "comment" => "public keywords (interests) of the contact"],
226 "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
227 "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
228 "attag" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
229 "avatar" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
230 "photo" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo of the contact"],
231 "thumb" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (thumb size)"],
232 "micro" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (micro size)"],
233 "site-pubkey" => ["type" => "text", "comment" => ""],
234 "issued-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
235 "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
236 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
237 "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
238 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
239 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
240 "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
241 "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
242 "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
243 "request" => ["type" => "varchar(255)", "comment" => ""],
244 "notify" => ["type" => "varchar(255)", "comment" => ""],
245 "poll" => ["type" => "varchar(255)", "comment" => ""],
246 "confirm" => ["type" => "varchar(255)", "comment" => ""],
247 "poco" => ["type" => "varchar(255)", "comment" => ""],
248 "aes_allow" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
249 "ret-aes" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
250 "usehub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
251 "subhub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
252 "hub-verify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
253 "last-update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last try to update the contact info"],
254 "success_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful contact update"],
255 "failure_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed update"],
256 "name-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
257 "uri-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
258 "avatar-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
259 "term-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
260 "last-item" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "date of the last post"],
261 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
262 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "Node-wide block status"],
263 "block_reason" => ["type" => "text", "comment" => "Node-wide block reason"],
264 "readonly" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "posts of the contact are readonly"],
265 "writable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
266 "forum" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a forum"],
267 "prv" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a private group"],
268 "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
269 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
270 "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
271 "pending" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
272 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact has been deleted"],
273 "rating" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
274 "unsearchable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact prefers to not be searchable"],
275 "sensitive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact posts sensitive content"],
276 "baseurl" => ["type" => "varchar(255)", "default" => "", "comment" => "baseurl of the contact"],
277 "reason" => ["type" => "text", "comment" => ""],
278 "closeness" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "99", "comment" => ""],
279 "info" => ["type" => "mediumtext", "comment" => ""],
280 "profile-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
281 "bdyear" => ["type" => "varchar(4)", "not null" => "1", "default" => "", "comment" => ""],
282 "bd" => ["type" => "date", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""],
283 "notify_new_posts" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
284 "fetch_further_information" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
285 "ffi_keyword_blacklist" => ["type" => "text", "comment" => ""],
289 "uid_name" => ["uid", "name(190)"],
290 "self_uid" => ["self", "uid"],
291 "alias_uid" => ["alias(32)", "uid"],
292 "pending_uid" => ["pending", "uid"],
293 "blocked_uid" => ["blocked", "uid"],
294 "uid_rel_network_poll" => ["uid", "rel", "network", "poll(64)", "archive"],
295 "uid_network_batch" => ["uid", "network", "batch(64)"],
296 "addr_uid" => ["addr(32)", "uid"],
297 "nurl_uid" => ["nurl(32)", "uid"],
298 "nick_uid" => ["nick(32)", "uid"],
299 "dfrn-id" => ["dfrn-id(64)"],
300 "issued-id" => ["issued-id(64)"],
304 "comment" => "private messages",
306 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
307 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this conversation"],
308 "recips" => ["type" => "text", "comment" => "sender_handle;recipient_handle"],
309 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
310 "creator" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "handle of creator"],
311 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation timestamp"],
312 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "edited timestamp"],
313 "subject" => ["type" => "text", "comment" => "subject of initial message"],
321 "comment" => "Raw data and structure information for messages",
323 "item-uri" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "Original URI of the item - unrelated to the table with the same name"],
324 "reply-to-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "URI to which this item is a reply"],
325 "conversation-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation URI"],
326 "conversation-href" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation link"],
327 "protocol" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "255", "comment" => "The protocol of the item"],
328 "source" => ["type" => "mediumtext", "comment" => "Original source"],
329 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Receiving date"],
332 "PRIMARY" => ["item-uri"],
333 "conversation-uri" => ["conversation-uri"],
334 "received" => ["received"],
337 "diaspora-interaction" => [
338 "comment" => "Signed Diaspora Interaction",
340 "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"],
341 "interaction" => ["type" => "mediumtext", "comment" => "The Diaspora interaction"]
344 "PRIMARY" => ["uri-id"]
348 "comment" => "Events",
350 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
351 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
352 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
353 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact_id (ID of the contact in contact table)"],
354 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
355 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
356 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
357 "start" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event start time"],
358 "finish" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event end time"],
359 "summary" => ["type" => "text", "comment" => "short description or title of the event"],
360 "desc" => ["type" => "text", "comment" => "event description"],
361 "location" => ["type" => "text", "comment" => "event location"],
362 "type" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => "event or birthday"],
363 "nofinish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if event does have no end this is 1"],
364 "adjust" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "adjust to timezone of the recipient (0 or 1)"],
365 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "0 or 1"],
366 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
367 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
368 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
369 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
373 "uid_start" => ["uid", "start"],
377 "comment" => "Diaspora compatible contacts - used in the Diaspora implementation",
379 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
380 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "unique id"],
381 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
382 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
383 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
384 "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
385 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
386 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
387 "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
388 "notify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
389 "poll" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
390 "confirm" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
391 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
392 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
393 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
394 "pubkey" => ["type" => "text", "comment" => ""],
395 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
399 "addr" => ["addr(32)"],
400 "url" => ["UNIQUE", "url(190)"],
404 "comment" => "friend suggestion stuff",
406 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
407 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
408 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
409 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
410 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
411 "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
412 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
413 "note" => ["type" => "text", "comment" => ""],
414 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
421 "comment" => "contacts ignored by friend suggestions",
423 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
424 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Local User id"],
425 "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => "gcontact.id of ignored contact"],
434 "comment" => "global contacts",
436 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
437 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"],
438 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"],
439 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the contacts profile page"],
440 "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
441 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the profile photo"],
442 "connect" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
443 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
444 "updated" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
445 "last_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
446 "last_failure" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
447 "archive_date" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
448 "archived" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
449 "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
450 "about" => ["type" => "text", "comment" => ""],
451 "keywords" => ["type" => "text", "comment" => "puplic keywords (interests)"],
452 "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
453 "birthday" => ["type" => "varchar(32)", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""],
454 "community" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if contact is forum account"],
455 "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "-1", "comment" => ""],
456 "hide" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = should be hidden from search"],
457 "nsfw" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = contact posts nsfw content"],
458 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "social network protocol"],
459 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
460 "notify" => ["type" => "varchar(255)", "comment" => ""],
461 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
462 "generation" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
463 "server_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "baseurl of the contacts server"],
467 "nurl" => ["UNIQUE", "nurl(190)"],
468 "name" => ["name(64)"],
469 "nick" => ["nick(32)"],
470 "addr" => ["addr(64)"],
471 "hide_network_updated" => ["hide", "network", "updated"],
472 "updated" => ["updated"],
476 "comment" => "'friends of friends' linkages derived from poco",
478 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
479 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
480 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
481 "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
482 "zcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
483 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
487 "cid_uid_gcid_zcid" => ["UNIQUE", "cid", "uid", "gcid", "zcid"],
492 "comment" => "privacy groups, group info",
494 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
495 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
496 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the member list is not private"],
497 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the group has been deleted"],
498 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "human readable name of group"],
506 "comment" => "privacy groups, member info",
508 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
509 "gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["group" => "id"], "comment" => "groups.id of the associated group"],
510 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id of the member assigned to the associated group"],
514 "contactid" => ["contact-id"],
515 "gid_contactid" => ["UNIQUE", "gid", "contact-id"],
519 "comment" => "Global servers",
521 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
522 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
523 "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
524 "version" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
525 "site_name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
526 "info" => ["type" => "text", "comment" => ""],
527 "register_policy" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
528 "registered-users" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Number of registered users"],
529 "directory-type" => ["type" => "tinyint", "default" => "0", "comment" => "Type of directory service (Poco, Mastodon)"],
530 "poco" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
531 "noscrape" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
532 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
533 "platform" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
534 "relay-subscribe" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Has the server subscribed to the relay system"],
535 "relay-scope" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => "The scope of messages that the server wants to get"],
536 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
537 "last_poco_query" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
538 "last_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
539 "last_failure" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
543 "nurl" => ["UNIQUE", "nurl(190)"],
547 "comment" => "Tags that the server has subscribed",
549 "gserver-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gserver" => "id"], "primary" => "1",
550 "comment" => "The id of the gserver"],
551 "tag" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "primary" => "1", "comment" => "Tag that the server has subscribed"],
554 "PRIMARY" => ["gserver-id", "tag"],
559 "comment" => "addon hook registry",
561 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
562 "hook" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => "name of hook"],
563 "file" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "relative filename of hook handler"],
564 "function" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "function name of hook handler"],
565 "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"],
569 "hook_file_function" => ["UNIQUE", "hook", "file", "function"],
573 "comment" => "Status of ActivityPub inboxes",
575 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URL of the inbox"],
576 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date of this entry"],
577 "success" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful delivery"],
578 "failure" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed delivery"],
579 "previous" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Previous delivery date"],
580 "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the inbox archived?"],
581 "shared" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is it a shared inbox?"]
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" => "User id"],
592 "fid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["fcontact" => "id"], "comment" => ""],
593 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
594 "knowyou" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
595 "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
596 "note" => ["type" => "text", "comment" => ""],
597 "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
598 "datetime" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
599 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
600 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
607 "comment" => "Structure for all posts",
609 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
610 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this item"],
611 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
612 "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
613 "uri-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
614 "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"],
615 "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "uri of the parent to this item"],
616 "parent-uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the parent uri"],
617 "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"],
618 "thr-parent-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"],
619 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation timestamp."],
620 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last edit (default is created)"],
621 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last comment/reply to this item"],
622 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime"],
623 "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"],
624 "gravity" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
625 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network from where the item comes from"],
626 "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"],
627 "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"],
628 "icid" => ["type" => "int unsigned", "relation" => ["item-content" => "id"], "comment" => "Id of the item-content table entry that contains the whole item content"],
629 "iaid" => ["type" => "int unsigned", "relation" => ["item-activity" => "id"], "comment" => "Id of the item-activity table entry that contains the activity data"],
630 "extid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
631 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"],
632 "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
633 "private" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "distribution is restricted"],
634 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
635 "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
636 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been deleted"],
637 // User specific fields. Eventually they will move to user-item
638 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
639 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
640 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "This item was posted to the wall of uid"],
641 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item originated at this site"],
642 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
643 "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been favourited"],
644 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "item has not been seen"],
645 "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "The owner of this item was mentioned in it"],
646 "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
647 "psid" => ["type" => "int unsigned", "relation" => ["permissionset" => "id"], "comment" => "ID of the permission set of this post"],
648 // It has to be decided whether these fields belong to the user or the structure
649 "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"],
650 "event-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["event" => "id"], "comment" => "Used to link to the event.id"],
651 // Could possibly be replaced by the "attach" table?
652 "attach" => ["type" => "mediumtext", "comment" => "JSON structure representing attachments to this item"],
653 // Deprecated fields. Will be removed in upcoming versions
654 "allow_cid" => ["type" => "mediumtext", "comment" => "Deprecated"],
655 "allow_gid" => ["type" => "mediumtext", "comment" => "Deprecated"],
656 "deny_cid" => ["type" => "mediumtext", "comment" => "Deprecated"],
657 "deny_gid" => ["type" => "mediumtext", "comment" => "Deprecated"],
658 "postopts" => ["type" => "text", "comment" => "Deprecated"],
659 "inform" => ["type" => "mediumtext", "comment" => "Deprecated"],
660 "type" => ["type" => "varchar(20)", "comment" => "Deprecated"],
661 "bookmark" => ["type" => "boolean", "comment" => "Deprecated"],
662 "file" => ["type" => "mediumtext", "comment" => "Deprecated"],
663 "location" => ["type" => "varchar(255)", "comment" => "Deprecated"],
664 "coord" => ["type" => "varchar(255)", "comment" => "Deprecated"],
665 "tag" => ["type" => "mediumtext", "comment" => "Deprecated"],
666 "plink" => ["type" => "varchar(255)", "comment" => "Deprecated"],
667 "title" => ["type" => "varchar(255)", "comment" => "Deprecated"],
668 "content-warning" => ["type" => "varchar(255)", "comment" => "Deprecated"],
669 "body" => ["type" => "mediumtext", "comment" => "Deprecated"],
670 "app" => ["type" => "varchar(255)", "comment" => "Deprecated"],
671 "verb" => ["type" => "varchar(100)", "comment" => "Deprecated"],
672 "object-type" => ["type" => "varchar(100)", "comment" => "Deprecated"],
673 "object" => ["type" => "text", "comment" => "Deprecated"],
674 "target-type" => ["type" => "varchar(100)", "comment" => "Deprecated"],
675 "target" => ["type" => "text", "comment" => "Deprecated"],
676 "author-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
677 "author-link" => ["type" => "varchar(255)", "comment" => "Deprecated"],
678 "author-avatar" => ["type" => "varchar(255)", "comment" => "Deprecated"],
679 "owner-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
680 "owner-link" => ["type" => "varchar(255)", "comment" => "Deprecated"],
681 "owner-avatar" => ["type" => "varchar(255)", "comment" => "Deprecated"],
682 "rendered-hash" => ["type" => "varchar(32)", "comment" => "Deprecated"],
683 "rendered-html" => ["type" => "mediumtext", "comment" => "Deprecated"],
687 "guid" => ["guid(191)"],
688 "uri" => ["uri(191)"],
689 "parent" => ["parent"],
690 "parent-uri" => ["parent-uri(191)"],
691 "extid" => ["extid(191)"],
692 "uid_id" => ["uid", "id"],
693 "uid_contactid_id" => ["uid", "contact-id", "id"],
694 "uid_received" => ["uid", "received"],
695 "uid_commented" => ["uid", "commented"],
696 "uid_unseen_contactid" => ["uid", "unseen", "contact-id"],
697 "uid_network_received" => ["uid", "network", "received"],
698 "uid_network_commented" => ["uid", "network", "commented"],
699 "uid_thrparent" => ["uid", "thr-parent(190)"],
700 "uid_parenturi" => ["uid", "parent-uri(190)"],
701 "uid_contactid_received" => ["uid", "contact-id", "received"],
702 "authorid_received" => ["author-id", "received"],
703 "ownerid" => ["owner-id"],
704 "contact-id" => ["contact-id"],
705 "uid_uri" => ["uid", "uri(190)"],
706 "resource-id" => ["resource-id"],
707 "deleted_changed" => ["deleted", "changed"],
708 "uid_wall_changed" => ["uid", "wall", "changed"],
709 "mention_uid_id" => ["mention", "uid", "id"],
710 "uid_eventid" => ["uid", "event-id"],
713 "psid_wall" => ["psid", "wall"],
717 "comment" => "Activities for items",
719 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
720 "uri" => ["type" => "varchar(255)", "comment" => ""],
721 "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
722 "uri-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
723 "activity" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""]
727 "uri-hash" => ["UNIQUE", "uri-hash"],
728 "uri" => ["uri(191)"],
729 "uri-id" => ["uri-id"]
733 "comment" => "Content for all posts",
735 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
736 "uri" => ["type" => "varchar(255)", "comment" => ""],
737 "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
738 "uri-plink-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
739 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "item title"],
740 "content-warning" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
741 "body" => ["type" => "mediumtext", "comment" => "item body content"],
742 "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "text location where this item originated"],
743 "coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "longitude/latitude pair representing location where this item originated"],
744 "language" => ["type" => "text", "comment" => "Language information about this post"],
745 "app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "application which generated this item"],
746 "rendered-hash" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
747 "rendered-html" => ["type" => "mediumtext", "comment" => "item.body converted to html"],
748 "object-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams object type"],
749 "object" => ["type" => "text", "comment" => "JSON encoded object structure unless it is an implied object (normal post)"],
750 "target-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams target type if applicable (URI)"],
751 "target" => ["type" => "text", "comment" => "JSON encoded target structure if used"],
752 "plink" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "permalink or URL to a displayable copy of the message at its source"],
753 "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams verb"]
757 "uri-plink-hash" => ["UNIQUE", "uri-plink-hash"],
758 "uri" => ["uri(191)"],
759 "plink" => ["plink(191)"],
760 "uri-id" => ["uri-id"]
763 "item-delivery-data" => [
764 "comment" => "Delivery data for items",
766 "iid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["item" => "id"], "comment" => "Item id"],
767 "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"],
768 "inform" => ["type" => "mediumtext", "comment" => "Additional receivers of the linked item"],
769 "queue_count" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Initial number of delivery recipients, used as item.delivery_queue_count"],
770 "queue_done" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries, used as item.delivery_queue_done"],
771 "queue_failed" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of unsuccessful deliveries, used as item.delivery_queue_failed"],
772 "activitypub" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via ActivityPub"],
773 "dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via DFRN"],
774 "legacy_dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via legacy DFRN"],
775 "diaspora" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via Diaspora"],
776 "ostatus" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via OStatus"],
779 "PRIMARY" => ["iid"],
783 "comment" => "URI and GUID for items",
785 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
786 "uri" => ["type" => "varbinary(255)", "not null" => "1", "comment" => "URI of an item"],
787 "guid" => ["type" => "varbinary(255)", "comment" => "A unique identifier for an item"]
791 "uri" => ["UNIQUE", "uri"],
798 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
799 "name" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => ""],
800 "locked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
801 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process ID"],
802 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
806 "name_expires" => ["name", "expires"]
810 "comment" => "private messages",
812 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
813 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
814 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this private message"],
815 "from-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "name of the sender"],
816 "from-photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "contact photo link of the sender"],
817 "from-url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "profile linke of the sender"],
818 "contact-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "relation" => ["contact" => "id"], "comment" => "contact.id"],
819 "convid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["conv" => "id"], "comment" => "conv.id"],
820 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
821 "body" => ["type" => "mediumtext", "comment" => ""],
822 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if message visited it is 1"],
823 "reply" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
824 "replied" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
825 "unknown" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if sender not in the contact table this is 1"],
826 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
827 "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
828 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time of the private message"],
832 "uid_seen" => ["uid", "seen"],
833 "convid" => ["convid"],
834 "uri" => ["uri(64)"],
835 "parent-uri" => ["parent-uri(64)"],
836 "contactid" => ["contact-id(32)"],
840 "comment" => "Mail account data for fetching mails",
842 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
843 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
844 "server" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
845 "port" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
846 "ssltype" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
847 "mailbox" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
848 "user" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
849 "pass" => ["type" => "text", "comment" => ""],
850 "reply_to" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
851 "action" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
852 "movetofolder" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
853 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
854 "last_check" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
861 "comment" => "table of accounts that can manage each other",
863 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
864 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
865 "mid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
869 "uid_mid" => ["UNIQUE", "uid", "mid"],
873 "comment" => "notifications",
875 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
876 "type" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
877 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
878 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
879 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
880 "date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
881 "msg" => ["type" => "mediumtext", "comment" => ""],
882 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
883 "link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
884 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id"],
885 "parent" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
886 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
887 "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""],
888 "otype" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => ""],
889 "name_cache" => ["type" => "tinytext", "comment" => "Cached bbcode parsing of name"],
890 "msg_cache" => ["type" => "mediumtext", "comment" => "Cached bbcode parsing of msg"]
894 "seen_uid_date" => ["seen", "uid", "date"],
895 "uid_date" => ["uid", "date"],
896 "uid_type_link" => ["uid", "type", "link(190)"],
899 "notify-threads" => [
902 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
903 "notify-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["notify" => "id"], "comment" => ""],
904 "master-parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"],
906 "parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
907 "receiver-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"],
908 "comment" => "User id"],
915 "comment" => "cache for OEmbed queries",
917 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
918 "maxwidth" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "comment" => "Maximum width passed to Oembed"],
919 "content" => ["type" => "mediumtext", "comment" => "OEmbed data of the page"],
920 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
923 "PRIMARY" => ["url", "maxwidth"],
924 "created" => ["created"],
927 "openwebauth-token" => [
928 "comment" => "Store OpenWebAuth token to verify contacts",
930 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
931 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
932 "type" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Verify type"],
933 "token" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A generated token"],
934 "meta" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
935 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
942 "comment" => "cache for 'parse_url' queries",
944 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
945 "guessing" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the 'guessing' mode active?"],
946 "oembed" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the data the result of oembed?"],
947 "content" => ["type" => "mediumtext", "comment" => "page data"],
948 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
951 "PRIMARY" => ["url", "guessing", "oembed"],
952 "created" => ["created"],
956 "comment" => "Storage for participation messages from Diaspora",
958 "iid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["item" => "id"], "comment" => ""],
959 "server" => ["type" => "varchar(60)", "not null" => "1", "primary" => "1", "comment" => ""],
960 "cid" => ["type" => "int unsigned", "not null" => "1", "relation" => ["contact" => "id"], "comment" => ""],
961 "fid" => ["type" => "int unsigned", "not null" => "1", "relation" => ["fcontact" => "id"], "comment" => ""],
964 "PRIMARY" => ["iid", "server"],
970 "comment" => "personal (per user) configuration storage",
972 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
973 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
974 "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
975 "k" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => ""],
976 "v" => ["type" => "mediumtext", "comment" => ""],
980 "uid_cat_k" => ["UNIQUE", "uid", "cat", "k"],
986 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
987 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner id of this permission set"],
988 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
989 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
990 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
991 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
995 "uid_allow_cid_allow_gid_deny_cid_deny_gid" => ["allow_cid(50)", "allow_gid(30)", "deny_cid(50)", "deny_gid(30)"],
999 "comment" => "photo storage",
1001 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1002 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
1003 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
1004 "guid" => ["type" => "char(16)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this photo"],
1005 "resource-id" => ["type" => "char(32)", "not null" => "1", "default" => "", "comment" => ""],
1006 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation date"],
1007 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edited date"],
1008 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1009 "desc" => ["type" => "text", "comment" => ""],
1010 "album" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "The name of the album to which the photo belongs"],
1011 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1012 "type" => ["type" => "varchar(30)", "not null" => "1", "default" => "image/jpeg"],
1013 "height" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1014 "width" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1015 "datasize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1016 "data" => ["type" => "mediumblob", "not null" => "1", "comment" => ""],
1017 "scale" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1018 "profile" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1019 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
1020 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
1021 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
1022 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
1023 "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
1024 "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"],
1025 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
1028 "PRIMARY" => ["id"],
1029 "contactid" => ["contact-id"],
1030 "uid_contactid" => ["uid", "contact-id"],
1031 "uid_profile" => ["uid", "profile"],
1032 "uid_album_scale_created" => ["uid", "album(32)", "scale", "created"],
1033 "uid_album_resource-id_created" => ["uid", "album(32)", "resource-id", "created"],
1034 "resource-id" => ["resource-id"],
1038 "comment" => "Currently unused table for storing poll results",
1040 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
1041 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1042 "q0" => ["type" => "text", "comment" => ""],
1043 "q1" => ["type" => "text", "comment" => ""],
1044 "q2" => ["type" => "text", "comment" => ""],
1045 "q3" => ["type" => "text", "comment" => ""],
1046 "q4" => ["type" => "text", "comment" => ""],
1047 "q5" => ["type" => "text", "comment" => ""],
1048 "q6" => ["type" => "text", "comment" => ""],
1049 "q7" => ["type" => "text", "comment" => ""],
1050 "q8" => ["type" => "text", "comment" => ""],
1051 "q9" => ["type" => "text", "comment" => ""],
1054 "PRIMARY" => ["id"],
1059 "comment" => "data for polls - currently unused",
1061 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1062 "poll_id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["poll" => "id"]],
1063 "choice" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1066 "PRIMARY" => ["id"],
1067 "poll_id" => ["poll_id"],
1071 "comment" => "Currently running system processes",
1073 "pid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "comment" => ""],
1074 "command" => ["type" => "varbinary(32)", "not null" => "1", "default" => "", "comment" => ""],
1075 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1078 "PRIMARY" => ["pid"],
1079 "command" => ["command"],
1083 "comment" => "user profiles data",
1085 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1086 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
1087 "profile-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name of the profile"],
1088 "is-default" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Mark this profile as default profile"],
1089 "hide-friends" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide friend list from viewers of this profile"],
1090 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1091 "pdesc" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Title or description"],
1092 "dob" => ["type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00", "comment" => "Day of birth"],
1093 "address" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1094 "locality" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1095 "region" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1096 "postal-code" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1097 "country-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1098 "hometown" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1099 "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1100 "marital" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1101 "with" => ["type" => "text", "comment" => ""],
1102 "howlong" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1103 "sexual" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1104 "politic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1105 "religion" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1106 "pub_keywords" => ["type" => "text", "comment" => ""],
1107 "prv_keywords" => ["type" => "text", "comment" => ""],
1108 "likes" => ["type" => "text", "comment" => ""],
1109 "dislikes" => ["type" => "text", "comment" => ""],
1110 "about" => ["type" => "text", "comment" => ""],
1111 "summary" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1112 "music" => ["type" => "text", "comment" => ""],
1113 "book" => ["type" => "text", "comment" => ""],
1114 "tv" => ["type" => "text", "comment" => ""],
1115 "film" => ["type" => "text", "comment" => ""],
1116 "interest" => ["type" => "text", "comment" => ""],
1117 "romance" => ["type" => "text", "comment" => ""],
1118 "work" => ["type" => "text", "comment" => ""],
1119 "education" => ["type" => "text", "comment" => ""],
1120 "contact" => ["type" => "text", "comment" => ""],
1121 "homepage" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1122 "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1123 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1124 "thumb" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1125 "publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish default profile in local directory"],
1126 "net-publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish profile in global directory"],
1129 "PRIMARY" => ["id"],
1130 "uid_is-default" => ["uid", "is-default"],
1131 "pub_keywords" => ["FULLTEXT", "pub_keywords"],
1134 "profile_check" => [
1135 "comment" => "DFRN remote auth use",
1137 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1138 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1139 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
1140 "dfrn_id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1141 "sec" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1142 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1145 "PRIMARY" => ["id"],
1148 "push_subscriber" => [
1149 "comment" => "Used for OStatus: Contains feed subscribers",
1151 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1152 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1153 "callback_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1154 "topic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1155 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1156 "push" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1157 "last_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last successful trial"],
1158 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1159 "renewed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last subscription renewal"],
1160 "secret" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1163 "PRIMARY" => ["id"],
1164 "next_try" => ["next_try"],
1168 "comment" => "registrations requiring admin approval",
1170 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1171 "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1172 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1173 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1174 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1175 "language" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
1176 "note" => ["type" => "text", "comment" => ""],
1179 "PRIMARY" => ["id"],
1185 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1186 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1187 "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1190 "PRIMARY" => ["id"],
1195 "comment" => "web session storage",
1197 "id" => ["type" => "bigint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1198 "sid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
1199 "data" => ["type" => "text", "comment" => ""],
1200 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1203 "PRIMARY" => ["id"],
1204 "sid" => ["sid(64)"],
1205 "expire" => ["expire"],
1209 "comment" => "Diaspora signatures",
1211 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1212 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id"],
1213 "signed_text" => ["type" => "mediumtext", "comment" => ""],
1214 "signature" => ["type" => "text", "comment" => ""],
1215 "signer" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1218 "PRIMARY" => ["id"],
1219 "iid" => ["UNIQUE", "iid"],
1223 "comment" => "item taxonomy (categories, tags, etc.) table",
1225 "tid" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
1226 "oid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
1227 "otype" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1228 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1229 "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1230 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1231 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1232 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1233 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1234 "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1235 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1238 "PRIMARY" => ["tid"],
1239 "term_type" => ["term(64)", "type"],
1240 "oid_otype_type_term" => ["oid", "otype", "type", "term(32)"],
1241 "uid_otype_type_term_global_created" => ["uid", "otype", "type", "term(32)", "global", "created"],
1242 "uid_otype_type_url" => ["uid", "otype", "type", "url(64)"],
1243 "guid" => ["guid(64)"],
1247 "comment" => "Thread related data",
1249 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"],
1250 "comment" => "sequential ID"],
1251 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1252 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
1253 "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item owner"],
1254 "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item author"],
1255 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1256 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1257 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1258 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1259 "changed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1260 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1261 "private" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1262 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1263 "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1264 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1265 "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1266 "ignored" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1267 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"],
1268 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
1269 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1270 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1271 "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1272 "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1273 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
1274 "bookmark" => ["type" => "boolean", "comment" => ""],
1277 "PRIMARY" => ["iid"],
1278 "uid_network_commented" => ["uid", "network", "commented"],
1279 "uid_network_received" => ["uid", "network", "received"],
1280 "uid_contactid_commented" => ["uid", "contact-id", "commented"],
1281 "uid_contactid_received" => ["uid", "contact-id", "received"],
1282 "contactid" => ["contact-id"],
1283 "ownerid" => ["owner-id"],
1284 "authorid" => ["author-id"],
1285 "uid_received" => ["uid", "received"],
1286 "uid_commented" => ["uid", "commented"],
1287 "uid_wall_received" => ["uid", "wall", "received"],
1288 "private_wall_origin_commented" => ["private", "wall", "origin", "commented"],
1292 "comment" => "OAuth usage",
1294 "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""],
1295 "secret" => ["type" => "text", "comment" => ""],
1296 "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "relation" => ["clients" => "client_id"]],
1297 "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
1298 "scope" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
1299 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1302 "PRIMARY" => ["id"],
1306 "comment" => "The local users",
1308 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1309 "parent-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"],
1310 "comment" => "The parent user that has full control about this user"],
1311 "guid" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this user"],
1312 "username" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this user is known by"],
1313 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "encrypted password"],
1314 "legacy_password" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the password hash double-hashed?"],
1315 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "nick- and user name"],
1316 "email" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "the users email address"],
1317 "openid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1318 "timezone" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => "PHP-legal timezone"],
1319 "language" => ["type" => "varchar(32)", "not null" => "1", "default" => "en", "comment" => "default language"],
1320 "register_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of registration"],
1321 "login_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last login"],
1322 "default-location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Default for item.location"],
1323 "allow_location" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 allows to display the location"],
1324 "theme" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "user theme preference"],
1325 "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
1326 "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
1327 "spubkey" => ["type" => "text", "comment" => ""],
1328 "sprvkey" => ["type" => "text", "comment" => ""],
1329 "verified" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "user is verified through email"],
1330 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 for user is blocked"],
1331 "blockwall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to post to the profile page of the user"],
1332 "hidewall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide profile details from unkown viewers"],
1333 "blocktags" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to tag the post of this user"],
1334 "unkmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Permit unknown people to send private mails to this user"],
1335 "cntunkmail" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
1336 "notify-flags" => ["type" => "smallint unsigned", "not null" => "1", "default" => "65535", "comment" => "email notification options"],
1337 "page-flags" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "page/profile type"],
1338 "account-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1339 "prvnets" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1340 "pwdreset" => ["type" => "varchar(255)", "comment" => "Password reset request token"],
1341 "pwdreset_time" => ["type" => "datetime", "comment" => "Timestamp of the last password reset request"],
1342 "maxreq" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
1343 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1344 "account_removed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if 1 the account is removed"],
1345 "account_expired" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1346 "account_expires_on" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp when account expires and will be deleted"],
1347 "expire_notification_sent" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last warning of account expiration"],
1348 "def_gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1349 "allow_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1350 "allow_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1351 "deny_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1352 "deny_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1353 "openidserver" => ["type" => "text", "comment" => ""],
1356 "PRIMARY" => ["uid"],
1357 "nickname" => ["nickname(32)"],
1361 "comment" => "Deleted usernames",
1363 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1364 "username" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
1367 "PRIMARY" => ["id"],
1368 "username" => ["username(32)"],
1372 "comment" => "User specific public contact data",
1374 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["contact" => "id"], "comment" => "Contact id of the linked public contact"],
1375 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
1376 "blocked" => ["type" => "boolean", "comment" => "Contact is completely blocked for this user"],
1377 "ignored" => ["type" => "boolean", "comment" => "Posts from this contact are ignored"],
1378 "collapsed" => ["type" => "boolean", "comment" => "Posts from this contact are collapsed"]
1381 "PRIMARY" => ["uid", "cid"]
1385 "comment" => "User specific item data",
1387 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"], "comment" => "Item id"],
1388 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
1389 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide an item from the user"],
1390 "ignored" => ["type" => "boolean", "comment" => "Ignore this thread if set"],
1391 "pinned" => ["type" => "boolean", "comment" => "The item is pinned on the profile page"],
1392 "notification-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1395 "PRIMARY" => ["uid", "iid"],
1396 "uid_pinned" => ["uid", "pinned"],
1397 "iid_uid" => ["iid", "uid"]
1401 "comment" => "Inter process communication between the frontend and the worker",
1403 "key" => ["type" => "int", "not null" => "1", "primary" => "1", "comment" => ""],
1404 "jobs" => ["type" => "boolean", "comment" => "Flag for outstanding jobs"],
1407 "PRIMARY" => ["key"],
1409 "engine" => "MEMORY",
1412 "comment" => "Background tasks queue entries",
1414 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented worker task id"],
1415 "parameter" => ["type" => "mediumtext", "comment" => "Task command"],
1416 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Task priority"],
1417 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date"],
1418 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process id of the worker"],
1419 "executed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Execution date"],
1420 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1421 "retrial" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1422 "done" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marked 1 when the task was done - will be deleted later"],
1425 "PRIMARY" => ["id"],
1426 "done_parameter" => ["done", "parameter(64)"],
1427 "done_executed" => ["done", "executed"],
1428 "done_priority_created" => ["done", "priority", "created"],
1429 "done_priority_next_try" => ["done", "priority", "next_try"],
1430 "done_pid_next_try" => ["done", "pid", "next_try"],
1431 "done_pid_priority_created" => ["done", "pid", "priority", "created"]
1435 "comment" => "Data stored by Database storage backend",
1437 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented image data id"],
1438 "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"]