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', 1313);
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 "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
427 "about" => ["type" => "text", "comment" => ""],
428 "keywords" => ["type" => "text", "comment" => "puplic keywords (interests)"],
429 "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
430 "birthday" => ["type" => "varchar(32)", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""],
431 "community" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if contact is forum account"],
432 "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "-1", "comment" => ""],
433 "hide" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = should be hidden from search"],
434 "nsfw" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = contact posts nsfw content"],
435 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "social network protocol"],
436 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
437 "notify" => ["type" => "varchar(255)", "comment" => ""],
438 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
439 "generation" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
440 "server_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "baseurl of the contacts server"],
444 "nurl" => ["UNIQUE", "nurl(190)"],
445 "name" => ["name(64)"],
446 "nick" => ["nick(32)"],
447 "addr" => ["addr(64)"],
448 "hide_network_updated" => ["hide", "network", "updated"],
449 "updated" => ["updated"],
453 "comment" => "'friends of friends' linkages derived from poco",
455 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
456 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
457 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
458 "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
459 "zcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
460 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
464 "cid_uid_gcid_zcid" => ["UNIQUE", "cid", "uid", "gcid", "zcid"],
469 "comment" => "privacy groups, group info",
471 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
472 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
473 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the member list is not private"],
474 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the group has been deleted"],
475 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "human readable name of group"],
483 "comment" => "privacy groups, member info",
485 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
486 "gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["group" => "id"], "comment" => "groups.id of the associated group"],
487 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id of the member assigned to the associated group"],
491 "contactid" => ["contact-id"],
492 "gid_contactid" => ["UNIQUE", "gid", "contact-id"],
496 "comment" => "Global servers",
498 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
499 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
500 "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
501 "version" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
502 "site_name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
503 "info" => ["type" => "text", "comment" => ""],
504 "register_policy" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
505 "registered-users" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Number of registered users"],
506 "poco" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
507 "noscrape" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
508 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
509 "platform" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
510 "relay-subscribe" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Has the server subscribed to the relay system"],
511 "relay-scope" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => "The scope of messages that the server wants to get"],
512 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
513 "last_poco_query" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
514 "last_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
515 "last_failure" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
519 "nurl" => ["UNIQUE", "nurl(190)"],
523 "comment" => "Tags that the server has subscribed",
525 "gserver-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gserver" => "id"], "primary" => "1",
526 "comment" => "The id of the gserver"],
527 "tag" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "primary" => "1", "comment" => "Tag that the server has subscribed"],
530 "PRIMARY" => ["gserver-id", "tag"],
535 "comment" => "addon hook registry",
537 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
538 "hook" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => "name of hook"],
539 "file" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "relative filename of hook handler"],
540 "function" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "function name of hook handler"],
541 "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"],
545 "hook_file_function" => ["UNIQUE", "hook", "file", "function"],
549 "comment" => "Status of ActivityPub inboxes",
551 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URL of the inbox"],
552 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date of this entry"],
553 "success" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful delivery"],
554 "failure" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed delivery"],
555 "previous" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Previous delivery date"],
556 "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the inbox archived?"],
557 "shared" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is it a shared inbox?"]
566 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
567 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
568 "fid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["fcontact" => "id"], "comment" => ""],
569 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
570 "knowyou" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
571 "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
572 "note" => ["type" => "text", "comment" => ""],
573 "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
574 "datetime" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
575 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
576 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
583 "comment" => "Structure for all posts",
585 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
586 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this item"],
587 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
588 "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
589 "uri-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
590 "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"],
591 "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "uri of the parent to this item"],
592 "parent-uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the parent uri"],
593 "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"],
594 "thr-parent-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"],
595 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation timestamp."],
596 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last edit (default is created)"],
597 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last comment/reply to this item"],
598 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime"],
599 "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"],
600 "gravity" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
601 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network from where the item comes from"],
602 "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"],
603 "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"],
604 "icid" => ["type" => "int unsigned", "relation" => ["item-content" => "id"], "comment" => "Id of the item-content table entry that contains the whole item content"],
605 "iaid" => ["type" => "int unsigned", "relation" => ["item-activity" => "id"], "comment" => "Id of the item-activity table entry that contains the activity data"],
606 "extid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
607 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"],
608 "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
609 "private" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "distribution is restricted"],
610 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
611 "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
612 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been deleted"],
613 // User specific fields. Eventually they will move to user-item
614 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
615 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
616 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "This item was posted to the wall of uid"],
617 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item originated at this site"],
618 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
619 "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been favourited"],
620 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "item has not been seen"],
621 "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "The owner of this item was mentioned in it"],
622 "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
623 "psid" => ["type" => "int unsigned", "relation" => ["permissionset" => "id"], "comment" => "ID of the permission set of this post"],
624 // It has to be decided whether these fields belong to the user or the structure
625 "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"],
626 "event-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["event" => "id"], "comment" => "Used to link to the event.id"],
627 // Could possibly be replaced by the "attach" table?
628 "attach" => ["type" => "mediumtext", "comment" => "JSON structure representing attachments to this item"],
629 // Deprecated fields. Will be removed in upcoming versions
630 "allow_cid" => ["type" => "mediumtext", "comment" => "Deprecated"],
631 "allow_gid" => ["type" => "mediumtext", "comment" => "Deprecated"],
632 "deny_cid" => ["type" => "mediumtext", "comment" => "Deprecated"],
633 "deny_gid" => ["type" => "mediumtext", "comment" => "Deprecated"],
634 "postopts" => ["type" => "text", "comment" => "Deprecated"],
635 "inform" => ["type" => "mediumtext", "comment" => "Deprecated"],
636 "type" => ["type" => "varchar(20)", "comment" => "Deprecated"],
637 "bookmark" => ["type" => "boolean", "comment" => "Deprecated"],
638 "file" => ["type" => "mediumtext", "comment" => "Deprecated"],
639 "location" => ["type" => "varchar(255)", "comment" => "Deprecated"],
640 "coord" => ["type" => "varchar(255)", "comment" => "Deprecated"],
641 "tag" => ["type" => "mediumtext", "comment" => "Deprecated"],
642 "plink" => ["type" => "varchar(255)", "comment" => "Deprecated"],
643 "title" => ["type" => "varchar(255)", "comment" => "Deprecated"],
644 "content-warning" => ["type" => "varchar(255)", "comment" => "Deprecated"],
645 "body" => ["type" => "mediumtext", "comment" => "Deprecated"],
646 "app" => ["type" => "varchar(255)", "comment" => "Deprecated"],
647 "verb" => ["type" => "varchar(100)", "comment" => "Deprecated"],
648 "object-type" => ["type" => "varchar(100)", "comment" => "Deprecated"],
649 "object" => ["type" => "text", "comment" => "Deprecated"],
650 "target-type" => ["type" => "varchar(100)", "comment" => "Deprecated"],
651 "target" => ["type" => "text", "comment" => "Deprecated"],
652 "author-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
653 "author-link" => ["type" => "varchar(255)", "comment" => "Deprecated"],
654 "author-avatar" => ["type" => "varchar(255)", "comment" => "Deprecated"],
655 "owner-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
656 "owner-link" => ["type" => "varchar(255)", "comment" => "Deprecated"],
657 "owner-avatar" => ["type" => "varchar(255)", "comment" => "Deprecated"],
658 "rendered-hash" => ["type" => "varchar(32)", "comment" => "Deprecated"],
659 "rendered-html" => ["type" => "mediumtext", "comment" => "Deprecated"],
663 "guid" => ["guid(191)"],
664 "uri" => ["uri(191)"],
665 "parent" => ["parent"],
666 "parent-uri" => ["parent-uri(191)"],
667 "extid" => ["extid(191)"],
668 "uid_id" => ["uid", "id"],
669 "uid_contactid_id" => ["uid", "contact-id", "id"],
670 "uid_created" => ["uid", "created"],
671 "uid_commented" => ["uid", "commented"],
672 "uid_unseen_contactid" => ["uid", "unseen", "contact-id"],
673 "uid_network_received" => ["uid", "network", "received"],
674 "uid_network_commented" => ["uid", "network", "commented"],
675 "uid_thrparent" => ["uid", "thr-parent(190)"],
676 "uid_parenturi" => ["uid", "parent-uri(190)"],
677 "uid_contactid_created" => ["uid", "contact-id", "created"],
678 "authorid_created" => ["author-id", "created"],
679 "ownerid" => ["owner-id"],
680 "contact-id" => ["contact-id"],
681 "uid_uri" => ["uid", "uri(190)"],
682 "resource-id" => ["resource-id"],
683 "deleted_changed" => ["deleted", "changed"],
684 "uid_wall_changed" => ["uid", "wall", "changed"],
685 "uid_eventid" => ["uid", "event-id"],
688 "psid_wall" => ["psid", "wall"],
692 "comment" => "Activities for items",
694 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
695 "uri" => ["type" => "varchar(255)", "comment" => ""],
696 "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
697 "uri-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
698 "activity" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""]
702 "uri-hash" => ["UNIQUE", "uri-hash"],
703 "uri" => ["uri(191)"],
704 "uri-id" => ["uri-id"]
708 "comment" => "Content for all posts",
710 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
711 "uri" => ["type" => "varchar(255)", "comment" => ""],
712 "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
713 "uri-plink-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
714 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "item title"],
715 "content-warning" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
716 "body" => ["type" => "mediumtext", "comment" => "item body content"],
717 "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "text location where this item originated"],
718 "coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "longitude/latitude pair representing location where this item originated"],
719 "language" => ["type" => "text", "comment" => "Language information about this post"],
720 "app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "application which generated this item"],
721 "rendered-hash" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
722 "rendered-html" => ["type" => "mediumtext", "comment" => "item.body converted to html"],
723 "object-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams object type"],
724 "object" => ["type" => "text", "comment" => "JSON encoded object structure unless it is an implied object (normal post)"],
725 "target-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams target type if applicable (URI)"],
726 "target" => ["type" => "text", "comment" => "JSON encoded target structure if used"],
727 "plink" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "permalink or URL to a displayable copy of the message at its source"],
728 "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams verb"]
732 "uri-plink-hash" => ["UNIQUE", "uri-plink-hash"],
733 "uri" => ["uri(191)"],
734 "uri-id" => ["uri-id"]
737 "item-delivery-data" => [
738 "comment" => "Delivery data for items",
740 "iid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["item" => "id"], "comment" => "Item id"],
741 "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"],
742 "inform" => ["type" => "mediumtext", "comment" => "Additional receivers of the linked item"],
743 "queue_count" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Initial number of delivery recipients, used as item.delivery_queue_count"],
744 "queue_done" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries, used as item.delivery_queue_done"],
747 "PRIMARY" => ["iid"],
751 "comment" => "URI and GUID for items",
753 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
754 "uri" => ["type" => "varbinary(255)", "not null" => "1", "comment" => "URI of an item"],
755 "guid" => ["type" => "varbinary(255)", "comment" => "A unique identifier for an item"]
759 "uri" => ["UNIQUE", "uri"],
766 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
767 "name" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => ""],
768 "locked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
769 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process ID"],
770 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
774 "name_expires" => ["name", "expires"]
778 "comment" => "private messages",
780 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
781 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
782 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this private message"],
783 "from-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "name of the sender"],
784 "from-photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "contact photo link of the sender"],
785 "from-url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "profile linke of the sender"],
786 "contact-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "relation" => ["contact" => "id"], "comment" => "contact.id"],
787 "convid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["conv" => "id"], "comment" => "conv.id"],
788 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
789 "body" => ["type" => "mediumtext", "comment" => ""],
790 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if message visited it is 1"],
791 "reply" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
792 "replied" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
793 "unknown" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if sender not in the contact table this is 1"],
794 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
795 "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
796 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time of the private message"],
800 "uid_seen" => ["uid", "seen"],
801 "convid" => ["convid"],
802 "uri" => ["uri(64)"],
803 "parent-uri" => ["parent-uri(64)"],
804 "contactid" => ["contact-id(32)"],
808 "comment" => "Mail account data for fetching mails",
810 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
811 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
812 "server" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
813 "port" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
814 "ssltype" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
815 "mailbox" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
816 "user" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
817 "pass" => ["type" => "text", "comment" => ""],
818 "reply_to" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
819 "action" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
820 "movetofolder" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
821 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
822 "last_check" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
829 "comment" => "table of accounts that can manage each other",
831 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
832 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
833 "mid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
837 "uid_mid" => ["UNIQUE", "uid", "mid"],
841 "comment" => "notifications",
843 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
844 "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => ""],
845 "type" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
846 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
847 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
848 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
849 "date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
850 "msg" => ["type" => "mediumtext", "comment" => ""],
851 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
852 "link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
853 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id"],
854 "parent" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
855 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
856 "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""],
857 "otype" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => ""],
858 "name_cache" => ["type" => "tinytext", "comment" => "Cached bbcode parsing of name"],
859 "msg_cache" => ["type" => "mediumtext", "comment" => "Cached bbcode parsing of msg"]
863 "hash_uid" => ["hash", "uid"],
864 "seen_uid_date" => ["seen", "uid", "date"],
865 "uid_date" => ["uid", "date"],
866 "uid_type_link" => ["uid", "type", "link(190)"],
869 "notify-threads" => [
872 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
873 "notify-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["notify" => "id"], "comment" => ""],
874 "master-parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"],
876 "parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
877 "receiver-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"],
878 "comment" => "User id"],
885 "comment" => "cache for OEmbed queries",
887 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
888 "maxwidth" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "comment" => "Maximum width passed to Oembed"],
889 "content" => ["type" => "mediumtext", "comment" => "OEmbed data of the page"],
890 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
893 "PRIMARY" => ["url", "maxwidth"],
894 "created" => ["created"],
897 "openwebauth-token" => [
898 "comment" => "Store OpenWebAuth token to verify contacts",
900 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
901 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
902 "type" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Verify type"],
903 "token" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A generated token"],
904 "meta" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
905 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
912 "comment" => "cache for 'parse_url' queries",
914 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
915 "guessing" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the 'guessing' mode active?"],
916 "oembed" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the data the result of oembed?"],
917 "content" => ["type" => "mediumtext", "comment" => "page data"],
918 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
921 "PRIMARY" => ["url", "guessing", "oembed"],
922 "created" => ["created"],
926 "comment" => "Storage for participation messages from Diaspora",
928 "iid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["item" => "id"], "comment" => ""],
929 "server" => ["type" => "varchar(60)", "not null" => "1", "primary" => "1", "comment" => ""],
930 "cid" => ["type" => "int unsigned", "not null" => "1", "relation" => ["contact" => "id"], "comment" => ""],
931 "fid" => ["type" => "int unsigned", "not null" => "1", "relation" => ["fcontact" => "id"], "comment" => ""],
934 "PRIMARY" => ["iid", "server"],
940 "comment" => "personal (per user) configuration storage",
942 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
943 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
944 "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
945 "k" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => ""],
946 "v" => ["type" => "mediumtext", "comment" => ""],
950 "uid_cat_k" => ["UNIQUE", "uid", "cat", "k"],
956 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
957 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner id of this permission set"],
958 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
959 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
960 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
961 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
965 "uid_allow_cid_allow_gid_deny_cid_deny_gid" => ["allow_cid(50)", "allow_gid(30)", "deny_cid(50)", "deny_gid(30)"],
969 "comment" => "photo storage",
971 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
972 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
973 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
974 "guid" => ["type" => "char(16)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this photo"],
975 "resource-id" => ["type" => "char(32)", "not null" => "1", "default" => "", "comment" => ""],
976 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation date"],
977 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edited date"],
978 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
979 "desc" => ["type" => "text", "comment" => ""],
980 "album" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "The name of the album to which the photo belongs"],
981 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
982 "type" => ["type" => "varchar(30)", "not null" => "1", "default" => "image/jpeg"],
983 "height" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
984 "width" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
985 "datasize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
986 "data" => ["type" => "mediumblob", "not null" => "1", "comment" => ""],
987 "scale" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
988 "profile" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
989 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
990 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
991 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
992 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
993 "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
994 "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"],
995 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
999 "contactid" => ["contact-id"],
1000 "uid_contactid" => ["uid", "contact-id"],
1001 "uid_profile" => ["uid", "profile"],
1002 "uid_album_scale_created" => ["uid", "album(32)", "scale", "created"],
1003 "uid_album_resource-id_created" => ["uid", "album(32)", "resource-id", "created"],
1004 "resource-id" => ["resource-id"],
1008 "comment" => "Currently unused table for storing poll results",
1010 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
1011 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1012 "q0" => ["type" => "text", "comment" => ""],
1013 "q1" => ["type" => "text", "comment" => ""],
1014 "q2" => ["type" => "text", "comment" => ""],
1015 "q3" => ["type" => "text", "comment" => ""],
1016 "q4" => ["type" => "text", "comment" => ""],
1017 "q5" => ["type" => "text", "comment" => ""],
1018 "q6" => ["type" => "text", "comment" => ""],
1019 "q7" => ["type" => "text", "comment" => ""],
1020 "q8" => ["type" => "text", "comment" => ""],
1021 "q9" => ["type" => "text", "comment" => ""],
1024 "PRIMARY" => ["id"],
1029 "comment" => "data for polls - currently unused",
1031 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1032 "poll_id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["poll" => "id"]],
1033 "choice" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1036 "PRIMARY" => ["id"],
1037 "poll_id" => ["poll_id"],
1041 "comment" => "Currently running system processes",
1043 "pid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "comment" => ""],
1044 "command" => ["type" => "varbinary(32)", "not null" => "1", "default" => "", "comment" => ""],
1045 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1048 "PRIMARY" => ["pid"],
1049 "command" => ["command"],
1053 "comment" => "user profiles data",
1055 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1056 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
1057 "profile-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name of the profile"],
1058 "is-default" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Mark this profile as default profile"],
1059 "hide-friends" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide friend list from viewers of this profile"],
1060 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1061 "pdesc" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Title or description"],
1062 "dob" => ["type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00", "comment" => "Day of birth"],
1063 "address" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1064 "locality" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1065 "region" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1066 "postal-code" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1067 "country-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1068 "hometown" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1069 "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1070 "marital" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1071 "with" => ["type" => "text", "comment" => ""],
1072 "howlong" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1073 "sexual" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1074 "politic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1075 "religion" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1076 "pub_keywords" => ["type" => "text", "comment" => ""],
1077 "prv_keywords" => ["type" => "text", "comment" => ""],
1078 "likes" => ["type" => "text", "comment" => ""],
1079 "dislikes" => ["type" => "text", "comment" => ""],
1080 "about" => ["type" => "text", "comment" => ""],
1081 "summary" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1082 "music" => ["type" => "text", "comment" => ""],
1083 "book" => ["type" => "text", "comment" => ""],
1084 "tv" => ["type" => "text", "comment" => ""],
1085 "film" => ["type" => "text", "comment" => ""],
1086 "interest" => ["type" => "text", "comment" => ""],
1087 "romance" => ["type" => "text", "comment" => ""],
1088 "work" => ["type" => "text", "comment" => ""],
1089 "education" => ["type" => "text", "comment" => ""],
1090 "contact" => ["type" => "text", "comment" => ""],
1091 "homepage" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1092 "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1093 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1094 "thumb" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1095 "publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish default profile in local directory"],
1096 "net-publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish profile in global directory"],
1099 "PRIMARY" => ["id"],
1100 "uid_is-default" => ["uid", "is-default"],
1101 "pub_keywords" => ["FULLTEXT", "pub_keywords"],
1104 "profile_check" => [
1105 "comment" => "DFRN remote auth use",
1107 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1108 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1109 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
1110 "dfrn_id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1111 "sec" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1112 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1115 "PRIMARY" => ["id"],
1118 "push_subscriber" => [
1119 "comment" => "Used for OStatus: Contains feed subscribers",
1121 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1122 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1123 "callback_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1124 "topic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1125 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1126 "push" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1127 "last_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last successful trial"],
1128 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1129 "renewed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last subscription renewal"],
1130 "secret" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1133 "PRIMARY" => ["id"],
1134 "next_try" => ["next_try"],
1138 "comment" => "registrations requiring admin approval",
1140 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1141 "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1142 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1143 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1144 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1145 "language" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
1146 "note" => ["type" => "text", "comment" => ""],
1149 "PRIMARY" => ["id"],
1155 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1156 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1157 "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1160 "PRIMARY" => ["id"],
1165 "comment" => "web session storage",
1167 "id" => ["type" => "bigint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1168 "sid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
1169 "data" => ["type" => "text", "comment" => ""],
1170 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1173 "PRIMARY" => ["id"],
1174 "sid" => ["sid(64)"],
1175 "expire" => ["expire"],
1179 "comment" => "Diaspora signatures",
1181 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1182 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id"],
1183 "signed_text" => ["type" => "mediumtext", "comment" => ""],
1184 "signature" => ["type" => "text", "comment" => ""],
1185 "signer" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1188 "PRIMARY" => ["id"],
1189 "iid" => ["UNIQUE", "iid"],
1193 "comment" => "item taxonomy (categories, tags, etc.) table",
1195 "tid" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
1196 "oid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
1197 "otype" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1198 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1199 "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1200 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1201 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1202 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1203 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1204 "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1205 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1208 "PRIMARY" => ["tid"],
1209 "term_type" => ["term(64)", "type"],
1210 "oid_otype_type_term" => ["oid", "otype", "type", "term(32)"],
1211 "uid_otype_type_term_global_created" => ["uid", "otype", "type", "term(32)", "global", "created"],
1212 "uid_otype_type_url" => ["uid", "otype", "type", "url(64)"],
1213 "guid" => ["guid(64)"],
1217 "comment" => "Thread related data",
1219 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"],
1220 "comment" => "sequential ID"],
1221 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1222 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
1223 "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item owner"],
1224 "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item author"],
1225 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1226 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1227 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1228 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1229 "changed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1230 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1231 "private" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1232 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1233 "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1234 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1235 "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1236 "ignored" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1237 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"],
1238 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
1239 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1240 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1241 "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1242 "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1243 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
1244 "bookmark" => ["type" => "boolean", "comment" => ""],
1247 "PRIMARY" => ["iid"],
1248 "uid_network_commented" => ["uid", "network", "commented"],
1249 "uid_network_created" => ["uid", "network", "created"],
1250 "uid_contactid_commented" => ["uid", "contact-id", "commented"],
1251 "uid_contactid_created" => ["uid", "contact-id", "created"],
1252 "contactid" => ["contact-id"],
1253 "ownerid" => ["owner-id"],
1254 "authorid" => ["author-id"],
1255 "uid_created" => ["uid", "created"],
1256 "uid_commented" => ["uid", "commented"],
1257 "uid_wall_created" => ["uid", "wall", "created"],
1258 "private_wall_origin_commented" => ["private", "wall", "origin", "commented"],
1262 "comment" => "OAuth usage",
1264 "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""],
1265 "secret" => ["type" => "text", "comment" => ""],
1266 "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "relation" => ["clients" => "client_id"]],
1267 "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
1268 "scope" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
1269 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1272 "PRIMARY" => ["id"],
1276 "comment" => "The local users",
1278 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1279 "parent-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"],
1280 "comment" => "The parent user that has full control about this user"],
1281 "guid" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this user"],
1282 "username" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this user is known by"],
1283 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "encrypted password"],
1284 "legacy_password" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the password hash double-hashed?"],
1285 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "nick- and user name"],
1286 "email" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "the users email address"],
1287 "openid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1288 "timezone" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => "PHP-legal timezone"],
1289 "language" => ["type" => "varchar(32)", "not null" => "1", "default" => "en", "comment" => "default language"],
1290 "register_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of registration"],
1291 "login_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last login"],
1292 "default-location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Default for item.location"],
1293 "allow_location" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 allows to display the location"],
1294 "theme" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "user theme preference"],
1295 "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
1296 "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
1297 "spubkey" => ["type" => "text", "comment" => ""],
1298 "sprvkey" => ["type" => "text", "comment" => ""],
1299 "verified" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "user is verified through email"],
1300 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 for user is blocked"],
1301 "blockwall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to post to the profile page of the user"],
1302 "hidewall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide profile details from unkown viewers"],
1303 "blocktags" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to tag the post of this user"],
1304 "unkmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Permit unknown people to send private mails to this user"],
1305 "cntunkmail" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
1306 "notify-flags" => ["type" => "smallint unsigned", "not null" => "1", "default" => "65535", "comment" => "email notification options"],
1307 "page-flags" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "page/profile type"],
1308 "account-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1309 "prvnets" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1310 "pwdreset" => ["type" => "varchar(255)", "comment" => "Password reset request token"],
1311 "pwdreset_time" => ["type" => "datetime", "comment" => "Timestamp of the last password reset request"],
1312 "maxreq" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
1313 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1314 "account_removed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if 1 the account is removed"],
1315 "account_expired" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1316 "account_expires_on" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp when account expires and will be deleted"],
1317 "expire_notification_sent" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last warning of account expiration"],
1318 "def_gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1319 "allow_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1320 "allow_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1321 "deny_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1322 "deny_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1323 "openidserver" => ["type" => "text", "comment" => ""],
1326 "PRIMARY" => ["uid"],
1327 "nickname" => ["nickname(32)"],
1331 "comment" => "Deleted usernames",
1333 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1334 "username" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
1337 "PRIMARY" => ["id"],
1338 "username" => ["username(32)"],
1342 "comment" => "User specific public contact data",
1344 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["contact" => "id"], "comment" => "Contact id of the linked public contact"],
1345 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
1346 "blocked" => ["type" => "boolean", "comment" => "Contact is completely blocked for this user"],
1347 "ignored" => ["type" => "boolean", "comment" => "Posts from this contact are ignored"],
1348 "collapsed" => ["type" => "boolean", "comment" => "Posts from this contact are collapsed"]
1351 "PRIMARY" => ["uid", "cid"]
1355 "comment" => "User specific item data",
1357 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"], "comment" => "Item id"],
1358 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
1359 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide an item from the user"],
1360 "ignored" => ["type" => "boolean", "comment" => "Ignore this thread if set"]
1363 "PRIMARY" => ["uid", "iid"]
1367 "comment" => "Inter process communication between the frontend and the worker",
1369 "key" => ["type" => "int", "not null" => "1", "primary" => "1", "comment" => ""],
1370 "jobs" => ["type" => "boolean", "comment" => "Flag for outstanding jobs"],
1373 "PRIMARY" => ["key"],
1375 "engine" => "MEMORY",
1378 "comment" => "Background tasks queue entries",
1380 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented worker task id"],
1381 "parameter" => ["type" => "mediumtext", "comment" => "Task command"],
1382 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Task priority"],
1383 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date"],
1384 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process id of the worker"],
1385 "executed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Execution date"],
1386 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1387 "retrial" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1388 "done" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marked 1 when the task was done - will be deleted later"],
1391 "PRIMARY" => ["id"],
1392 "done_parameter" => ["done", "parameter(64)"],
1393 "done_executed" => ["done", "executed"],
1394 "done_priority_created" => ["done", "priority", "created"],
1395 "done_priority_next_try" => ["done", "priority", "next_try"],
1396 "done_pid_next_try" => ["done", "pid", "next_try"],
1397 "done_pid_priority_created" => ["done", "pid", "priority", "created"]
1401 "comment" => "Data stored by Database storage backend",
1403 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented image data id"],
1404 "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"]