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', 1316);
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 "reason" => ["type" => "text", "comment" => ""],
257 "closeness" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "99", "comment" => ""],
258 "info" => ["type" => "mediumtext", "comment" => ""],
259 "profile-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
260 "bdyear" => ["type" => "varchar(4)", "not null" => "1", "default" => "", "comment" => ""],
261 "bd" => ["type" => "date", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""],
262 "notify_new_posts" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
263 "fetch_further_information" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
264 "ffi_keyword_blacklist" => ["type" => "text", "comment" => ""],
268 "uid_name" => ["uid", "name(190)"],
269 "self_uid" => ["self", "uid"],
270 "alias_uid" => ["alias(32)", "uid"],
271 "pending_uid" => ["pending", "uid"],
272 "blocked_uid" => ["blocked", "uid"],
273 "uid_rel_network_poll" => ["uid", "rel", "network", "poll(64)", "archive"],
274 "uid_network_batch" => ["uid", "network", "batch(64)"],
275 "addr_uid" => ["addr(32)", "uid"],
276 "nurl_uid" => ["nurl(32)", "uid"],
277 "nick_uid" => ["nick(32)", "uid"],
278 "dfrn-id" => ["dfrn-id(64)"],
279 "issued-id" => ["issued-id(64)"],
283 "comment" => "private messages",
285 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
286 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this conversation"],
287 "recips" => ["type" => "text", "comment" => "sender_handle;recipient_handle"],
288 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
289 "creator" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "handle of creator"],
290 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation timestamp"],
291 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "edited timestamp"],
292 "subject" => ["type" => "text", "comment" => "subject of initial message"],
300 "comment" => "Raw data and structure information for messages",
302 "item-uri" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "Original URI of the item - unrelated to the table with the same name"],
303 "reply-to-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "URI to which this item is a reply"],
304 "conversation-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation URI"],
305 "conversation-href" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation link"],
306 "protocol" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "255", "comment" => "The protocol of the item"],
307 "source" => ["type" => "mediumtext", "comment" => "Original source"],
308 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Receiving date"],
311 "PRIMARY" => ["item-uri"],
312 "conversation-uri" => ["conversation-uri"],
313 "received" => ["received"],
316 "diaspora-interaction" => [
317 "comment" => "Signed Diaspora Interaction",
319 "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"],
320 "interaction" => ["type" => "mediumtext", "comment" => "The Diaspora interaction"]
323 "PRIMARY" => ["uri-id"]
327 "comment" => "Events",
329 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
330 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
331 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
332 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact_id (ID of the contact in contact table)"],
333 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
334 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
335 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
336 "start" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event start time"],
337 "finish" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event end time"],
338 "summary" => ["type" => "text", "comment" => "short description or title of the event"],
339 "desc" => ["type" => "text", "comment" => "event description"],
340 "location" => ["type" => "text", "comment" => "event location"],
341 "type" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => "event or birthday"],
342 "nofinish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if event does have no end this is 1"],
343 "adjust" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "adjust to timezone of the recipient (0 or 1)"],
344 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "0 or 1"],
345 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
346 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
347 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
348 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
352 "uid_start" => ["uid", "start"],
356 "comment" => "Diaspora compatible contacts - used in the Diaspora implementation",
358 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
359 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "unique id"],
360 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
361 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
362 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
363 "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
364 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
365 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
366 "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
367 "notify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
368 "poll" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
369 "confirm" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
370 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
371 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
372 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
373 "pubkey" => ["type" => "text", "comment" => ""],
374 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
378 "addr" => ["addr(32)"],
379 "url" => ["UNIQUE", "url(190)"],
383 "comment" => "friend suggestion stuff",
385 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
386 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
387 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
388 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
389 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
390 "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
391 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
392 "note" => ["type" => "text", "comment" => ""],
393 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
400 "comment" => "contacts ignored by friend suggestions",
402 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
403 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Local User id"],
404 "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => "gcontact.id of ignored contact"],
413 "comment" => "global contacts",
415 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
416 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"],
417 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"],
418 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the contacts profile page"],
419 "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
420 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the profile photo"],
421 "connect" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
422 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
423 "updated" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
424 "last_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
425 "last_failure" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
426 "archive_date" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
427 "archived" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
428 "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
429 "about" => ["type" => "text", "comment" => ""],
430 "keywords" => ["type" => "text", "comment" => "puplic keywords (interests)"],
431 "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
432 "birthday" => ["type" => "varchar(32)", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""],
433 "community" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if contact is forum account"],
434 "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "-1", "comment" => ""],
435 "hide" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = should be hidden from search"],
436 "nsfw" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = contact posts nsfw content"],
437 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "social network protocol"],
438 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
439 "notify" => ["type" => "varchar(255)", "comment" => ""],
440 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
441 "generation" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
442 "server_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "baseurl of the contacts server"],
446 "nurl" => ["UNIQUE", "nurl(190)"],
447 "name" => ["name(64)"],
448 "nick" => ["nick(32)"],
449 "addr" => ["addr(64)"],
450 "hide_network_updated" => ["hide", "network", "updated"],
451 "updated" => ["updated"],
455 "comment" => "'friends of friends' linkages derived from poco",
457 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
458 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
459 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
460 "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
461 "zcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
462 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
466 "cid_uid_gcid_zcid" => ["UNIQUE", "cid", "uid", "gcid", "zcid"],
471 "comment" => "privacy groups, group info",
473 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
474 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
475 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the member list is not private"],
476 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the group has been deleted"],
477 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "human readable name of group"],
485 "comment" => "privacy groups, member info",
487 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
488 "gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["group" => "id"], "comment" => "groups.id of the associated group"],
489 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id of the member assigned to the associated group"],
493 "contactid" => ["contact-id"],
494 "gid_contactid" => ["UNIQUE", "gid", "contact-id"],
498 "comment" => "Global servers",
500 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
501 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
502 "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
503 "version" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
504 "site_name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
505 "info" => ["type" => "text", "comment" => ""],
506 "register_policy" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
507 "registered-users" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Number of registered users"],
508 "poco" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
509 "noscrape" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
510 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
511 "platform" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
512 "relay-subscribe" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Has the server subscribed to the relay system"],
513 "relay-scope" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => "The scope of messages that the server wants to get"],
514 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
515 "last_poco_query" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
516 "last_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
517 "last_failure" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
521 "nurl" => ["UNIQUE", "nurl(190)"],
525 "comment" => "Tags that the server has subscribed",
527 "gserver-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gserver" => "id"], "primary" => "1",
528 "comment" => "The id of the gserver"],
529 "tag" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "primary" => "1", "comment" => "Tag that the server has subscribed"],
532 "PRIMARY" => ["gserver-id", "tag"],
537 "comment" => "addon hook registry",
539 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
540 "hook" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => "name of hook"],
541 "file" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "relative filename of hook handler"],
542 "function" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "function name of hook handler"],
543 "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"],
547 "hook_file_function" => ["UNIQUE", "hook", "file", "function"],
551 "comment" => "Status of ActivityPub inboxes",
553 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URL of the inbox"],
554 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date of this entry"],
555 "success" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful delivery"],
556 "failure" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed delivery"],
557 "previous" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Previous delivery date"],
558 "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the inbox archived?"],
559 "shared" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is it a shared inbox?"]
568 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
569 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
570 "fid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["fcontact" => "id"], "comment" => ""],
571 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
572 "knowyou" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
573 "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
574 "note" => ["type" => "text", "comment" => ""],
575 "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
576 "datetime" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
577 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
578 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
585 "comment" => "Structure for all posts",
587 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
588 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this item"],
589 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
590 "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
591 "uri-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
592 "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"],
593 "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "uri of the parent to this item"],
594 "parent-uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the parent uri"],
595 "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"],
596 "thr-parent-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"],
597 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation timestamp."],
598 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last edit (default is created)"],
599 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last comment/reply to this item"],
600 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime"],
601 "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"],
602 "gravity" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
603 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network from where the item comes from"],
604 "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"],
605 "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"],
606 "icid" => ["type" => "int unsigned", "relation" => ["item-content" => "id"], "comment" => "Id of the item-content table entry that contains the whole item content"],
607 "iaid" => ["type" => "int unsigned", "relation" => ["item-activity" => "id"], "comment" => "Id of the item-activity table entry that contains the activity data"],
608 "extid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
609 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"],
610 "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
611 "private" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "distribution is restricted"],
612 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
613 "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
614 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been deleted"],
615 // User specific fields. Eventually they will move to user-item
616 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
617 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
618 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "This item was posted to the wall of uid"],
619 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item originated at this site"],
620 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
621 "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been favourited"],
622 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "item has not been seen"],
623 "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "The owner of this item was mentioned in it"],
624 "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
625 "psid" => ["type" => "int unsigned", "relation" => ["permissionset" => "id"], "comment" => "ID of the permission set of this post"],
626 // It has to be decided whether these fields belong to the user or the structure
627 "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"],
628 "event-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["event" => "id"], "comment" => "Used to link to the event.id"],
629 // Could possibly be replaced by the "attach" table?
630 "attach" => ["type" => "mediumtext", "comment" => "JSON structure representing attachments to this item"],
631 // Deprecated fields. Will be removed in upcoming versions
632 "allow_cid" => ["type" => "mediumtext", "comment" => "Deprecated"],
633 "allow_gid" => ["type" => "mediumtext", "comment" => "Deprecated"],
634 "deny_cid" => ["type" => "mediumtext", "comment" => "Deprecated"],
635 "deny_gid" => ["type" => "mediumtext", "comment" => "Deprecated"],
636 "postopts" => ["type" => "text", "comment" => "Deprecated"],
637 "inform" => ["type" => "mediumtext", "comment" => "Deprecated"],
638 "type" => ["type" => "varchar(20)", "comment" => "Deprecated"],
639 "bookmark" => ["type" => "boolean", "comment" => "Deprecated"],
640 "file" => ["type" => "mediumtext", "comment" => "Deprecated"],
641 "location" => ["type" => "varchar(255)", "comment" => "Deprecated"],
642 "coord" => ["type" => "varchar(255)", "comment" => "Deprecated"],
643 "tag" => ["type" => "mediumtext", "comment" => "Deprecated"],
644 "plink" => ["type" => "varchar(255)", "comment" => "Deprecated"],
645 "title" => ["type" => "varchar(255)", "comment" => "Deprecated"],
646 "content-warning" => ["type" => "varchar(255)", "comment" => "Deprecated"],
647 "body" => ["type" => "mediumtext", "comment" => "Deprecated"],
648 "app" => ["type" => "varchar(255)", "comment" => "Deprecated"],
649 "verb" => ["type" => "varchar(100)", "comment" => "Deprecated"],
650 "object-type" => ["type" => "varchar(100)", "comment" => "Deprecated"],
651 "object" => ["type" => "text", "comment" => "Deprecated"],
652 "target-type" => ["type" => "varchar(100)", "comment" => "Deprecated"],
653 "target" => ["type" => "text", "comment" => "Deprecated"],
654 "author-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
655 "author-link" => ["type" => "varchar(255)", "comment" => "Deprecated"],
656 "author-avatar" => ["type" => "varchar(255)", "comment" => "Deprecated"],
657 "owner-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
658 "owner-link" => ["type" => "varchar(255)", "comment" => "Deprecated"],
659 "owner-avatar" => ["type" => "varchar(255)", "comment" => "Deprecated"],
660 "rendered-hash" => ["type" => "varchar(32)", "comment" => "Deprecated"],
661 "rendered-html" => ["type" => "mediumtext", "comment" => "Deprecated"],
665 "guid" => ["guid(191)"],
666 "uri" => ["uri(191)"],
667 "parent" => ["parent"],
668 "parent-uri" => ["parent-uri(191)"],
669 "extid" => ["extid(191)"],
670 "uid_id" => ["uid", "id"],
671 "uid_contactid_id" => ["uid", "contact-id", "id"],
672 "uid_created" => ["uid", "created"],
673 "uid_commented" => ["uid", "commented"],
674 "uid_unseen_contactid" => ["uid", "unseen", "contact-id"],
675 "uid_network_received" => ["uid", "network", "received"],
676 "uid_network_commented" => ["uid", "network", "commented"],
677 "uid_thrparent" => ["uid", "thr-parent(190)"],
678 "uid_parenturi" => ["uid", "parent-uri(190)"],
679 "uid_contactid_created" => ["uid", "contact-id", "created"],
680 "authorid_created" => ["author-id", "created"],
681 "ownerid" => ["owner-id"],
682 "contact-id" => ["contact-id"],
683 "uid_uri" => ["uid", "uri(190)"],
684 "resource-id" => ["resource-id"],
685 "deleted_changed" => ["deleted", "changed"],
686 "uid_wall_changed" => ["uid", "wall", "changed"],
687 "uid_eventid" => ["uid", "event-id"],
690 "psid_wall" => ["psid", "wall"],
694 "comment" => "Activities for items",
696 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
697 "uri" => ["type" => "varchar(255)", "comment" => ""],
698 "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
699 "uri-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
700 "activity" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""]
704 "uri-hash" => ["UNIQUE", "uri-hash"],
705 "uri" => ["uri(191)"],
706 "uri-id" => ["uri-id"]
710 "comment" => "Content for all posts",
712 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
713 "uri" => ["type" => "varchar(255)", "comment" => ""],
714 "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
715 "uri-plink-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
716 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "item title"],
717 "content-warning" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
718 "body" => ["type" => "mediumtext", "comment" => "item body content"],
719 "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "text location where this item originated"],
720 "coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "longitude/latitude pair representing location where this item originated"],
721 "language" => ["type" => "text", "comment" => "Language information about this post"],
722 "app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "application which generated this item"],
723 "rendered-hash" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
724 "rendered-html" => ["type" => "mediumtext", "comment" => "item.body converted to html"],
725 "object-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams object type"],
726 "object" => ["type" => "text", "comment" => "JSON encoded object structure unless it is an implied object (normal post)"],
727 "target-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams target type if applicable (URI)"],
728 "target" => ["type" => "text", "comment" => "JSON encoded target structure if used"],
729 "plink" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "permalink or URL to a displayable copy of the message at its source"],
730 "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams verb"]
734 "uri-plink-hash" => ["UNIQUE", "uri-plink-hash"],
735 "uri" => ["uri(191)"],
736 "uri-id" => ["uri-id"]
739 "item-delivery-data" => [
740 "comment" => "Delivery data for items",
742 "iid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["item" => "id"], "comment" => "Item id"],
743 "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"],
744 "inform" => ["type" => "mediumtext", "comment" => "Additional receivers of the linked item"],
745 "queue_count" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Initial number of delivery recipients, used as item.delivery_queue_count"],
746 "queue_done" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries, used as item.delivery_queue_done"],
747 "activitypub" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via ActivityPub"],
748 "dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via DFRN"],
749 "legacy_dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via legacy DFRN"],
750 "diaspora" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via Diaspora"],
751 "ostatus" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via OStatus"],
754 "PRIMARY" => ["iid"],
758 "comment" => "URI and GUID for items",
760 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
761 "uri" => ["type" => "varbinary(255)", "not null" => "1", "comment" => "URI of an item"],
762 "guid" => ["type" => "varbinary(255)", "comment" => "A unique identifier for an item"]
766 "uri" => ["UNIQUE", "uri"],
773 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
774 "name" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => ""],
775 "locked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
776 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process ID"],
777 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
781 "name_expires" => ["name", "expires"]
785 "comment" => "private messages",
787 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
788 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
789 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this private message"],
790 "from-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "name of the sender"],
791 "from-photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "contact photo link of the sender"],
792 "from-url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "profile linke of the sender"],
793 "contact-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "relation" => ["contact" => "id"], "comment" => "contact.id"],
794 "convid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["conv" => "id"], "comment" => "conv.id"],
795 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
796 "body" => ["type" => "mediumtext", "comment" => ""],
797 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if message visited it is 1"],
798 "reply" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
799 "replied" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
800 "unknown" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if sender not in the contact table this is 1"],
801 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
802 "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
803 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time of the private message"],
807 "uid_seen" => ["uid", "seen"],
808 "convid" => ["convid"],
809 "uri" => ["uri(64)"],
810 "parent-uri" => ["parent-uri(64)"],
811 "contactid" => ["contact-id(32)"],
815 "comment" => "Mail account data for fetching mails",
817 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
818 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
819 "server" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
820 "port" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
821 "ssltype" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
822 "mailbox" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
823 "user" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
824 "pass" => ["type" => "text", "comment" => ""],
825 "reply_to" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
826 "action" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
827 "movetofolder" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
828 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
829 "last_check" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
836 "comment" => "table of accounts that can manage each other",
838 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
839 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
840 "mid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
844 "uid_mid" => ["UNIQUE", "uid", "mid"],
848 "comment" => "notifications",
850 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
851 "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => ""],
852 "type" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
853 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
854 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
855 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
856 "date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
857 "msg" => ["type" => "mediumtext", "comment" => ""],
858 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
859 "link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
860 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id"],
861 "parent" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
862 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
863 "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""],
864 "otype" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => ""],
865 "name_cache" => ["type" => "tinytext", "comment" => "Cached bbcode parsing of name"],
866 "msg_cache" => ["type" => "mediumtext", "comment" => "Cached bbcode parsing of msg"]
870 "hash_uid" => ["hash", "uid"],
871 "seen_uid_date" => ["seen", "uid", "date"],
872 "uid_date" => ["uid", "date"],
873 "uid_type_link" => ["uid", "type", "link(190)"],
876 "notify-threads" => [
879 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
880 "notify-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["notify" => "id"], "comment" => ""],
881 "master-parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"],
883 "parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
884 "receiver-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"],
885 "comment" => "User id"],
892 "comment" => "cache for OEmbed queries",
894 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
895 "maxwidth" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "comment" => "Maximum width passed to Oembed"],
896 "content" => ["type" => "mediumtext", "comment" => "OEmbed data of the page"],
897 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
900 "PRIMARY" => ["url", "maxwidth"],
901 "created" => ["created"],
904 "openwebauth-token" => [
905 "comment" => "Store OpenWebAuth token to verify contacts",
907 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
908 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
909 "type" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Verify type"],
910 "token" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A generated token"],
911 "meta" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
912 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
919 "comment" => "cache for 'parse_url' queries",
921 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
922 "guessing" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the 'guessing' mode active?"],
923 "oembed" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the data the result of oembed?"],
924 "content" => ["type" => "mediumtext", "comment" => "page data"],
925 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
928 "PRIMARY" => ["url", "guessing", "oembed"],
929 "created" => ["created"],
933 "comment" => "Storage for participation messages from Diaspora",
935 "iid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["item" => "id"], "comment" => ""],
936 "server" => ["type" => "varchar(60)", "not null" => "1", "primary" => "1", "comment" => ""],
937 "cid" => ["type" => "int unsigned", "not null" => "1", "relation" => ["contact" => "id"], "comment" => ""],
938 "fid" => ["type" => "int unsigned", "not null" => "1", "relation" => ["fcontact" => "id"], "comment" => ""],
941 "PRIMARY" => ["iid", "server"],
947 "comment" => "personal (per user) configuration storage",
949 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
950 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
951 "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
952 "k" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => ""],
953 "v" => ["type" => "mediumtext", "comment" => ""],
957 "uid_cat_k" => ["UNIQUE", "uid", "cat", "k"],
963 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
964 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner id of this permission set"],
965 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
966 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
967 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
968 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
972 "uid_allow_cid_allow_gid_deny_cid_deny_gid" => ["allow_cid(50)", "allow_gid(30)", "deny_cid(50)", "deny_gid(30)"],
976 "comment" => "photo storage",
978 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
979 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
980 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
981 "guid" => ["type" => "char(16)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this photo"],
982 "resource-id" => ["type" => "char(32)", "not null" => "1", "default" => "", "comment" => ""],
983 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation date"],
984 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edited date"],
985 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
986 "desc" => ["type" => "text", "comment" => ""],
987 "album" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "The name of the album to which the photo belongs"],
988 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
989 "type" => ["type" => "varchar(30)", "not null" => "1", "default" => "image/jpeg"],
990 "height" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
991 "width" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
992 "datasize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
993 "data" => ["type" => "mediumblob", "not null" => "1", "comment" => ""],
994 "scale" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
995 "profile" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
996 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
997 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
998 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
999 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
1000 "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
1001 "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"],
1002 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
1005 "PRIMARY" => ["id"],
1006 "contactid" => ["contact-id"],
1007 "uid_contactid" => ["uid", "contact-id"],
1008 "uid_profile" => ["uid", "profile"],
1009 "uid_album_scale_created" => ["uid", "album(32)", "scale", "created"],
1010 "uid_album_resource-id_created" => ["uid", "album(32)", "resource-id", "created"],
1011 "resource-id" => ["resource-id"],
1015 "comment" => "Currently unused table for storing poll results",
1017 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
1018 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1019 "q0" => ["type" => "text", "comment" => ""],
1020 "q1" => ["type" => "text", "comment" => ""],
1021 "q2" => ["type" => "text", "comment" => ""],
1022 "q3" => ["type" => "text", "comment" => ""],
1023 "q4" => ["type" => "text", "comment" => ""],
1024 "q5" => ["type" => "text", "comment" => ""],
1025 "q6" => ["type" => "text", "comment" => ""],
1026 "q7" => ["type" => "text", "comment" => ""],
1027 "q8" => ["type" => "text", "comment" => ""],
1028 "q9" => ["type" => "text", "comment" => ""],
1031 "PRIMARY" => ["id"],
1036 "comment" => "data for polls - currently unused",
1038 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1039 "poll_id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["poll" => "id"]],
1040 "choice" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1043 "PRIMARY" => ["id"],
1044 "poll_id" => ["poll_id"],
1048 "comment" => "Currently running system processes",
1050 "pid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "comment" => ""],
1051 "command" => ["type" => "varbinary(32)", "not null" => "1", "default" => "", "comment" => ""],
1052 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1055 "PRIMARY" => ["pid"],
1056 "command" => ["command"],
1060 "comment" => "user profiles data",
1062 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1063 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
1064 "profile-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name of the profile"],
1065 "is-default" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Mark this profile as default profile"],
1066 "hide-friends" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide friend list from viewers of this profile"],
1067 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1068 "pdesc" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Title or description"],
1069 "dob" => ["type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00", "comment" => "Day of birth"],
1070 "address" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1071 "locality" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1072 "region" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1073 "postal-code" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1074 "country-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1075 "hometown" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1076 "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1077 "marital" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1078 "with" => ["type" => "text", "comment" => ""],
1079 "howlong" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1080 "sexual" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1081 "politic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1082 "religion" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1083 "pub_keywords" => ["type" => "text", "comment" => ""],
1084 "prv_keywords" => ["type" => "text", "comment" => ""],
1085 "likes" => ["type" => "text", "comment" => ""],
1086 "dislikes" => ["type" => "text", "comment" => ""],
1087 "about" => ["type" => "text", "comment" => ""],
1088 "summary" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1089 "music" => ["type" => "text", "comment" => ""],
1090 "book" => ["type" => "text", "comment" => ""],
1091 "tv" => ["type" => "text", "comment" => ""],
1092 "film" => ["type" => "text", "comment" => ""],
1093 "interest" => ["type" => "text", "comment" => ""],
1094 "romance" => ["type" => "text", "comment" => ""],
1095 "work" => ["type" => "text", "comment" => ""],
1096 "education" => ["type" => "text", "comment" => ""],
1097 "contact" => ["type" => "text", "comment" => ""],
1098 "homepage" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1099 "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1100 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1101 "thumb" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1102 "publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish default profile in local directory"],
1103 "net-publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish profile in global directory"],
1106 "PRIMARY" => ["id"],
1107 "uid_is-default" => ["uid", "is-default"],
1108 "pub_keywords" => ["FULLTEXT", "pub_keywords"],
1111 "profile_check" => [
1112 "comment" => "DFRN remote auth use",
1114 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1115 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1116 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
1117 "dfrn_id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1118 "sec" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1119 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1122 "PRIMARY" => ["id"],
1125 "push_subscriber" => [
1126 "comment" => "Used for OStatus: Contains feed subscribers",
1128 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1129 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1130 "callback_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1131 "topic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1132 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1133 "push" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1134 "last_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last successful trial"],
1135 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1136 "renewed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last subscription renewal"],
1137 "secret" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1140 "PRIMARY" => ["id"],
1141 "next_try" => ["next_try"],
1145 "comment" => "registrations requiring admin approval",
1147 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1148 "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1149 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1150 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1151 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1152 "language" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
1153 "note" => ["type" => "text", "comment" => ""],
1156 "PRIMARY" => ["id"],
1162 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1163 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1164 "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1167 "PRIMARY" => ["id"],
1172 "comment" => "web session storage",
1174 "id" => ["type" => "bigint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1175 "sid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
1176 "data" => ["type" => "text", "comment" => ""],
1177 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1180 "PRIMARY" => ["id"],
1181 "sid" => ["sid(64)"],
1182 "expire" => ["expire"],
1186 "comment" => "Diaspora signatures",
1188 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1189 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id"],
1190 "signed_text" => ["type" => "mediumtext", "comment" => ""],
1191 "signature" => ["type" => "text", "comment" => ""],
1192 "signer" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1195 "PRIMARY" => ["id"],
1196 "iid" => ["UNIQUE", "iid"],
1200 "comment" => "item taxonomy (categories, tags, etc.) table",
1202 "tid" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
1203 "oid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
1204 "otype" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1205 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1206 "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1207 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1208 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1209 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1210 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1211 "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1212 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1215 "PRIMARY" => ["tid"],
1216 "term_type" => ["term(64)", "type"],
1217 "oid_otype_type_term" => ["oid", "otype", "type", "term(32)"],
1218 "uid_otype_type_term_global_created" => ["uid", "otype", "type", "term(32)", "global", "created"],
1219 "uid_otype_type_url" => ["uid", "otype", "type", "url(64)"],
1220 "guid" => ["guid(64)"],
1224 "comment" => "Thread related data",
1226 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"],
1227 "comment" => "sequential ID"],
1228 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1229 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
1230 "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item owner"],
1231 "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item author"],
1232 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1233 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1234 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1235 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1236 "changed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1237 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1238 "private" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1239 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1240 "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1241 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1242 "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1243 "ignored" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1244 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"],
1245 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
1246 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1247 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1248 "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1249 "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1250 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
1251 "bookmark" => ["type" => "boolean", "comment" => ""],
1254 "PRIMARY" => ["iid"],
1255 "uid_network_commented" => ["uid", "network", "commented"],
1256 "uid_network_created" => ["uid", "network", "created"],
1257 "uid_contactid_commented" => ["uid", "contact-id", "commented"],
1258 "uid_contactid_created" => ["uid", "contact-id", "created"],
1259 "contactid" => ["contact-id"],
1260 "ownerid" => ["owner-id"],
1261 "authorid" => ["author-id"],
1262 "uid_created" => ["uid", "created"],
1263 "uid_commented" => ["uid", "commented"],
1264 "uid_wall_created" => ["uid", "wall", "created"],
1265 "private_wall_origin_commented" => ["private", "wall", "origin", "commented"],
1269 "comment" => "OAuth usage",
1271 "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""],
1272 "secret" => ["type" => "text", "comment" => ""],
1273 "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "relation" => ["clients" => "client_id"]],
1274 "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
1275 "scope" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
1276 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1279 "PRIMARY" => ["id"],
1283 "comment" => "The local users",
1285 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1286 "parent-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"],
1287 "comment" => "The parent user that has full control about this user"],
1288 "guid" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this user"],
1289 "username" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this user is known by"],
1290 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "encrypted password"],
1291 "legacy_password" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the password hash double-hashed?"],
1292 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "nick- and user name"],
1293 "email" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "the users email address"],
1294 "openid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1295 "timezone" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => "PHP-legal timezone"],
1296 "language" => ["type" => "varchar(32)", "not null" => "1", "default" => "en", "comment" => "default language"],
1297 "register_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of registration"],
1298 "login_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last login"],
1299 "default-location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Default for item.location"],
1300 "allow_location" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 allows to display the location"],
1301 "theme" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "user theme preference"],
1302 "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
1303 "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
1304 "spubkey" => ["type" => "text", "comment" => ""],
1305 "sprvkey" => ["type" => "text", "comment" => ""],
1306 "verified" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "user is verified through email"],
1307 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 for user is blocked"],
1308 "blockwall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to post to the profile page of the user"],
1309 "hidewall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide profile details from unkown viewers"],
1310 "blocktags" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to tag the post of this user"],
1311 "unkmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Permit unknown people to send private mails to this user"],
1312 "cntunkmail" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
1313 "notify-flags" => ["type" => "smallint unsigned", "not null" => "1", "default" => "65535", "comment" => "email notification options"],
1314 "page-flags" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "page/profile type"],
1315 "account-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1316 "prvnets" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1317 "pwdreset" => ["type" => "varchar(255)", "comment" => "Password reset request token"],
1318 "pwdreset_time" => ["type" => "datetime", "comment" => "Timestamp of the last password reset request"],
1319 "maxreq" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
1320 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1321 "account_removed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if 1 the account is removed"],
1322 "account_expired" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1323 "account_expires_on" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp when account expires and will be deleted"],
1324 "expire_notification_sent" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last warning of account expiration"],
1325 "def_gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1326 "allow_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1327 "allow_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1328 "deny_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1329 "deny_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1330 "openidserver" => ["type" => "text", "comment" => ""],
1333 "PRIMARY" => ["uid"],
1334 "nickname" => ["nickname(32)"],
1338 "comment" => "Deleted usernames",
1340 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1341 "username" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
1344 "PRIMARY" => ["id"],
1345 "username" => ["username(32)"],
1349 "comment" => "User specific public contact data",
1351 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["contact" => "id"], "comment" => "Contact id of the linked public contact"],
1352 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
1353 "blocked" => ["type" => "boolean", "comment" => "Contact is completely blocked for this user"],
1354 "ignored" => ["type" => "boolean", "comment" => "Posts from this contact are ignored"],
1355 "collapsed" => ["type" => "boolean", "comment" => "Posts from this contact are collapsed"]
1358 "PRIMARY" => ["uid", "cid"]
1362 "comment" => "User specific item data",
1364 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"], "comment" => "Item id"],
1365 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
1366 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide an item from the user"],
1367 "ignored" => ["type" => "boolean", "comment" => "Ignore this thread if set"]
1370 "PRIMARY" => ["uid", "iid"]
1374 "comment" => "Inter process communication between the frontend and the worker",
1376 "key" => ["type" => "int", "not null" => "1", "primary" => "1", "comment" => ""],
1377 "jobs" => ["type" => "boolean", "comment" => "Flag for outstanding jobs"],
1380 "PRIMARY" => ["key"],
1382 "engine" => "MEMORY",
1385 "comment" => "Background tasks queue entries",
1387 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented worker task id"],
1388 "parameter" => ["type" => "mediumtext", "comment" => "Task command"],
1389 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Task priority"],
1390 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date"],
1391 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process id of the worker"],
1392 "executed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Execution date"],
1393 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1394 "retrial" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1395 "done" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marked 1 when the task was done - will be deleted later"],
1398 "PRIMARY" => ["id"],
1399 "done_parameter" => ["done", "parameter(64)"],
1400 "done_executed" => ["done", "executed"],
1401 "done_priority_created" => ["done", "priority", "created"],
1402 "done_priority_next_try" => ["done", "priority", "next_try"],
1403 "done_pid_next_try" => ["done", "pid", "next_try"],
1404 "done_pid_priority_created" => ["done", "pid", "priority", "created"]
1408 "comment" => "Data stored by Database storage backend",
1410 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented image data id"],
1411 "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"]