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', 1295);
42 "comment" => "registered addons",
44 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
45 "name" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "addon base (file)name"],
46 "version" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "currently unused"],
47 "installed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently always 1"],
48 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently unused"],
49 "timestamp" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "file timestamp to check for reloads"],
50 "plugin_admin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = has admin config, 0 = has no admin config"],
54 "name" => ["UNIQUE", "name"],
58 "comment" => "ActivityPub compatible contacts - used in the ActivityPub implementation",
60 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URL of the contact"],
61 "uuid" => ["type" => "varchar(255)", "comment" => ""],
62 "type" => ["type" => "varchar(20)", "not null" => "1", "comment" => ""],
63 "following" => ["type" => "varchar(255)", "comment" => ""],
64 "followers" => ["type" => "varchar(255)", "comment" => ""],
65 "inbox" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
66 "outbox" => ["type" => "varchar(255)", "comment" => ""],
67 "sharedinbox" => ["type" => "varchar(255)", "comment" => ""],
68 "manually-approve" => ["type" => "boolean", "comment" => ""],
69 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
70 "name" => ["type" => "varchar(255)", "comment" => ""],
71 "about" => ["type" => "text", "comment" => ""],
72 "photo" => ["type" => "varchar(255)", "comment" => ""],
73 "addr" => ["type" => "varchar(255)", "comment" => ""],
74 "alias" => ["type" => "varchar(255)", "comment" => ""],
75 "pubkey" => ["type" => "text", "comment" => ""],
76 "baseurl" => ["type" => "varchar(255)", "comment" => "baseurl of the ap contact"],
77 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
81 "addr" => ["addr(32)"],
82 "alias" => ["alias(190)"],
83 "url" => ["followers(190)"]
87 "comment" => "file attachments",
89 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "generated index"],
90 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
91 "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "hash"],
92 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "filename of original"],
93 "filetype" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "mimetype"],
94 "filesize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "size in bytes"],
95 "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"],
96 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
97 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
98 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>"],
99 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
100 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
101 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
108 "comment" => "OAuth usage",
110 "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""],
111 "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "relation" => ["clients" => "client_id"],
113 "redirect_uri" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
114 "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
115 "scope" => ["type" => "varchar(250)", "not null" => "1", "default" => "", "comment" => ""],
122 "comment" => "Stores temporary data",
124 "k" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "cache key"],
125 "v" => ["type" => "mediumtext", "comment" => "cached serialized value"],
126 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
127 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache insertion"],
131 "k_expires" => ["k", "expires"],
137 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
138 "challenge" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
139 "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
140 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
141 "type" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
142 "last_update" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
149 "comment" => "OAuth usage",
151 "client_id" => ["type" => "varchar(20)", "not null" => "1", "primary" => "1", "comment" => ""],
152 "pw" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => ""],
153 "redirect_uri" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
154 "name" => ["type" => "text", "comment" => ""],
155 "icon" => ["type" => "text", "comment" => ""],
156 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
159 "PRIMARY" => ["client_id"],
163 "comment" => "main configuration storage",
165 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
166 "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
167 "k" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
168 "v" => ["type" => "mediumtext", "comment" => ""],
172 "cat_k" => ["UNIQUE", "cat", "k"],
176 "comment" => "contact table",
178 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
179 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
180 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
181 "self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if the contact is the user him/her self"],
182 "remote_self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
183 "rel" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "The kind of the relation between the user and the contact"],
184 "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
185 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network protocol of the contact"],
186 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"],
187 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"],
188 "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
189 "about" => ["type" => "text", "comment" => ""],
190 "keywords" => ["type" => "text", "comment" => "public keywords (interests) of the contact"],
191 "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
192 "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
193 "attag" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
194 "avatar" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
195 "photo" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo of the contact"],
196 "thumb" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (thumb size)"],
197 "micro" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (micro size)"],
198 "site-pubkey" => ["type" => "text", "comment" => ""],
199 "issued-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
200 "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
201 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
202 "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
203 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
204 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
205 "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
206 "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
207 "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
208 "request" => ["type" => "varchar(255)", "comment" => ""],
209 "notify" => ["type" => "varchar(255)", "comment" => ""],
210 "poll" => ["type" => "varchar(255)", "comment" => ""],
211 "confirm" => ["type" => "varchar(255)", "comment" => ""],
212 "poco" => ["type" => "varchar(255)", "comment" => ""],
213 "aes_allow" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
214 "ret-aes" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
215 "usehub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
216 "subhub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
217 "hub-verify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
218 "last-update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last try to update the contact info"],
219 "success_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful contact update"],
220 "failure_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed update"],
221 "name-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
222 "uri-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
223 "avatar-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
224 "term-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
225 "last-item" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "date of the last post"],
226 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
227 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
228 "readonly" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "posts of the contact are readonly"],
229 "writable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
230 "forum" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a forum"],
231 "prv" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a private group"],
232 "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
233 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
234 "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
235 "pending" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
236 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact has been deleted"],
237 "rating" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
238 "reason" => ["type" => "text", "comment" => ""],
239 "closeness" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "99", "comment" => ""],
240 "info" => ["type" => "mediumtext", "comment" => ""],
241 "profile-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
242 "bdyear" => ["type" => "varchar(4)", "not null" => "1", "default" => "", "comment" => ""],
243 "bd" => ["type" => "date", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""],
244 "notify_new_posts" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
245 "fetch_further_information" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
246 "ffi_keyword_blacklist" => ["type" => "text", "comment" => ""],
250 "uid_name" => ["uid", "name(190)"],
251 "self_uid" => ["self", "uid"],
252 "alias_uid" => ["alias(32)", "uid"],
253 "pending_uid" => ["pending", "uid"],
254 "blocked_uid" => ["blocked", "uid"],
255 "uid_rel_network_poll" => ["uid", "rel", "network", "poll(64)", "archive"],
256 "uid_network_batch" => ["uid", "network", "batch(64)"],
257 "addr_uid" => ["addr(32)", "uid"],
258 "nurl_uid" => ["nurl(32)", "uid"],
259 "nick_uid" => ["nick(32)", "uid"],
260 "dfrn-id" => ["dfrn-id(64)"],
261 "issued-id" => ["issued-id(64)"],
265 "comment" => "private messages",
267 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
268 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this conversation"],
269 "recips" => ["type" => "text", "comment" => "sender_handle;recipient_handle"],
270 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
271 "creator" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "handle of creator"],
272 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation timestamp"],
273 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "edited timestamp"],
274 "subject" => ["type" => "text", "comment" => "subject of initial message"],
282 "comment" => "Raw data and structure information for messages",
284 "item-uri" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "Original URI of the item - unrelated to the table with the same name"],
285 "reply-to-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "URI to which this item is a reply"],
286 "conversation-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation URI"],
287 "conversation-href" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation link"],
288 "protocol" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "255", "comment" => "The protocol of the item"],
289 "source" => ["type" => "mediumtext", "comment" => "Original source"],
290 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Receiving date"],
293 "PRIMARY" => ["item-uri"],
294 "conversation-uri" => ["conversation-uri"],
295 "received" => ["received"],
298 "diaspora-interaction" => [
299 "comment" => "Signed Diaspora Interaction",
301 "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"],
302 "interaction" => ["type" => "mediumtext", "comment" => "The Diaspora interaction"]
305 "PRIMARY" => ["uri-id"]
309 "comment" => "Events",
311 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
312 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
313 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
314 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact_id (ID of the contact in contact table)"],
315 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
316 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
317 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
318 "start" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event start time"],
319 "finish" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event end time"],
320 "summary" => ["type" => "text", "comment" => "short description or title of the event"],
321 "desc" => ["type" => "text", "comment" => "event description"],
322 "location" => ["type" => "text", "comment" => "event location"],
323 "type" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => "event or birthday"],
324 "nofinish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if event does have no end this is 1"],
325 "adjust" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "adjust to timezone of the recipient (0 or 1)"],
326 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "0 or 1"],
327 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
328 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
329 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
330 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
334 "uid_start" => ["uid", "start"],
338 "comment" => "Diaspora compatible contacts - used in the Diaspora implementation",
340 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
341 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "unique id"],
342 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
343 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
344 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
345 "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
346 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
347 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
348 "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
349 "notify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
350 "poll" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
351 "confirm" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
352 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
353 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
354 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
355 "pubkey" => ["type" => "text", "comment" => ""],
356 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
360 "addr" => ["addr(32)"],
361 "url" => ["UNIQUE", "url(190)"],
365 "comment" => "friend suggestion stuff",
367 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
368 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
369 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
370 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
371 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
372 "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
373 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
374 "note" => ["type" => "text", "comment" => ""],
375 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
382 "comment" => "contacts ignored by friend suggestions",
384 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
385 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Local User id"],
386 "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => "gcontact.id of ignored contact"],
395 "comment" => "global contacts",
397 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
398 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"],
399 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"],
400 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the contacts profile page"],
401 "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
402 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the profile photo"],
403 "connect" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
404 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
405 "updated" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
406 "last_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
407 "last_failure" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
408 "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
409 "about" => ["type" => "text", "comment" => ""],
410 "keywords" => ["type" => "text", "comment" => "puplic keywords (interests)"],
411 "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
412 "birthday" => ["type" => "varchar(32)", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""],
413 "community" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if contact is forum account"],
414 "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "-1", "comment" => ""],
415 "hide" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = should be hidden from search"],
416 "nsfw" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = contact posts nsfw content"],
417 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "social network protocol"],
418 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
419 "notify" => ["type" => "varchar(255)", "comment" => ""],
420 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
421 "generation" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
422 "server_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "baseurl of the contacts server"],
426 "nurl" => ["UNIQUE", "nurl(190)"],
427 "name" => ["name(64)"],
428 "nick" => ["nick(32)"],
429 "addr" => ["addr(64)"],
430 "hide_network_updated" => ["hide", "network", "updated"],
431 "updated" => ["updated"],
435 "comment" => "'friends of friends' linkages derived from poco",
437 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
438 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
439 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
440 "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
441 "zcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
442 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
446 "cid_uid_gcid_zcid" => ["UNIQUE", "cid", "uid", "gcid", "zcid"],
451 "comment" => "privacy groups, group info",
453 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
454 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
455 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the member list is not private"],
456 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the group has been deleted"],
457 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "human readable name of group"],
465 "comment" => "privacy groups, member info",
467 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
468 "gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["group" => "id"], "comment" => "groups.id of the associated group"],
469 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id of the member assigned to the associated group"],
473 "contactid" => ["contact-id"],
474 "gid_contactid" => ["UNIQUE", "gid", "contact-id"],
478 "comment" => "Global servers",
480 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
481 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
482 "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
483 "version" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
484 "site_name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
485 "info" => ["type" => "text", "comment" => ""],
486 "register_policy" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
487 "registered-users" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Number of registered users"],
488 "poco" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
489 "noscrape" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
490 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
491 "platform" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
492 "relay-subscribe" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Has the server subscribed to the relay system"],
493 "relay-scope" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => "The scope of messages that the server wants to get"],
494 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
495 "last_poco_query" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
496 "last_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
497 "last_failure" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
501 "nurl" => ["UNIQUE", "nurl(190)"],
505 "comment" => "Tags that the server has subscribed",
507 "gserver-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gserver" => "id"], "primary" => "1",
508 "comment" => "The id of the gserver"],
509 "tag" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "primary" => "1", "comment" => "Tag that the server has subscribed"],
512 "PRIMARY" => ["gserver-id", "tag"],
517 "comment" => "addon hook registry",
519 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
520 "hook" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => "name of hook"],
521 "file" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "relative filename of hook handler"],
522 "function" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "function name of hook handler"],
523 "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"],
527 "hook_file_function" => ["UNIQUE", "hook", "file", "function"],
533 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
534 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
535 "fid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["fcontact" => "id"], "comment" => ""],
536 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
537 "knowyou" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
538 "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
539 "note" => ["type" => "text", "comment" => ""],
540 "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
541 "datetime" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
542 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
543 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
550 "comment" => "Structure for all posts",
552 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
553 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this item"],
554 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
555 "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
556 "uri-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
557 "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"],
558 "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "uri of the parent to this item"],
559 "parent-uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the parent uri"],
560 "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"],
561 "thr-parent-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"],
562 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation timestamp."],
563 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last edit (default is created)"],
564 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last comment/reply to this item"],
565 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime"],
566 "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"],
567 "gravity" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
568 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network from where the item comes from"],
569 "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"],
570 "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"],
571 "icid" => ["type" => "int unsigned", "relation" => ["item-content" => "id"], "comment" => "Id of the item-content table entry that contains the whole item content"],
572 "iaid" => ["type" => "int unsigned", "relation" => ["item-activity" => "id"], "comment" => "Id of the item-activity table entry that contains the activity data"],
573 "extid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
574 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"],
575 "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
576 "private" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "distribution is restricted"],
577 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
578 "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
579 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been deleted"],
580 // User specific fields. Eventually they will move to user-item
581 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
582 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
583 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "This item was posted to the wall of uid"],
584 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item originated at this site"],
585 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
586 "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been favourited"],
587 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "item has not been seen"],
588 "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "The owner of this item was mentioned in it"],
589 "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
590 "psid" => ["type" => "int unsigned", "relation" => ["permissionset" => "id"], "comment" => "ID of the permission set of this post"],
591 // It has to be decided whether these fields belong to the user or the structure
592 "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"],
593 "event-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["event" => "id"], "comment" => "Used to link to the event.id"],
594 // Could possibly be replaced by the "attach" table?
595 "attach" => ["type" => "mediumtext", "comment" => "JSON structure representing attachments to this item"],
596 // Deprecated fields. Will be removed in upcoming versions
597 "allow_cid" => ["type" => "mediumtext", "comment" => "Deprecated"],
598 "allow_gid" => ["type" => "mediumtext", "comment" => "Deprecated"],
599 "deny_cid" => ["type" => "mediumtext", "comment" => "Deprecated"],
600 "deny_gid" => ["type" => "mediumtext", "comment" => "Deprecated"],
601 "postopts" => ["type" => "text", "comment" => "Deprecated"],
602 "inform" => ["type" => "mediumtext", "comment" => "Deprecated"],
603 "type" => ["type" => "varchar(20)", "comment" => "Deprecated"],
604 "bookmark" => ["type" => "boolean", "comment" => "Deprecated"],
605 "file" => ["type" => "mediumtext", "comment" => "Deprecated"],
606 "location" => ["type" => "varchar(255)", "comment" => "Deprecated"],
607 "coord" => ["type" => "varchar(255)", "comment" => "Deprecated"],
608 "tag" => ["type" => "mediumtext", "comment" => "Deprecated"],
609 "plink" => ["type" => "varchar(255)", "comment" => "Deprecated"],
610 "title" => ["type" => "varchar(255)", "comment" => "Deprecated"],
611 "content-warning" => ["type" => "varchar(255)", "comment" => "Deprecated"],
612 "body" => ["type" => "mediumtext", "comment" => "Deprecated"],
613 "app" => ["type" => "varchar(255)", "comment" => "Deprecated"],
614 "verb" => ["type" => "varchar(100)", "comment" => "Deprecated"],
615 "object-type" => ["type" => "varchar(100)", "comment" => "Deprecated"],
616 "object" => ["type" => "text", "comment" => "Deprecated"],
617 "target-type" => ["type" => "varchar(100)", "comment" => "Deprecated"],
618 "target" => ["type" => "text", "comment" => "Deprecated"],
619 "author-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
620 "author-link" => ["type" => "varchar(255)", "comment" => "Deprecated"],
621 "author-avatar" => ["type" => "varchar(255)", "comment" => "Deprecated"],
622 "owner-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
623 "owner-link" => ["type" => "varchar(255)", "comment" => "Deprecated"],
624 "owner-avatar" => ["type" => "varchar(255)", "comment" => "Deprecated"],
625 "rendered-hash" => ["type" => "varchar(32)", "comment" => "Deprecated"],
626 "rendered-html" => ["type" => "mediumtext", "comment" => "Deprecated"],
630 "guid" => ["guid(191)"],
631 "uri" => ["uri(191)"],
632 "parent" => ["parent"],
633 "parent-uri" => ["parent-uri(191)"],
634 "extid" => ["extid(191)"],
635 "uid_id" => ["uid", "id"],
636 "uid_contactid_id" => ["uid", "contact-id", "id"],
637 "uid_created" => ["uid", "created"],
638 "uid_commented" => ["uid", "commented"],
639 "uid_unseen_contactid" => ["uid", "unseen", "contact-id"],
640 "uid_network_received" => ["uid", "network", "received"],
641 "uid_network_commented" => ["uid", "network", "commented"],
642 "uid_thrparent" => ["uid", "thr-parent(190)"],
643 "uid_parenturi" => ["uid", "parent-uri(190)"],
644 "uid_contactid_created" => ["uid", "contact-id", "created"],
645 "authorid_created" => ["author-id", "created"],
646 "ownerid" => ["owner-id"],
647 "contact-id" => ["contact-id"],
648 "uid_uri" => ["uid", "uri(190)"],
649 "resource-id" => ["resource-id"],
650 "deleted_changed" => ["deleted", "changed"],
651 "uid_wall_changed" => ["uid", "wall", "changed"],
652 "uid_eventid" => ["uid", "event-id"],
655 "psid_wall" => ["psid", "wall"],
659 "comment" => "Activities for items",
661 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
662 "uri" => ["type" => "varchar(255)", "comment" => ""],
663 "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
664 "uri-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
665 "activity" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""]
669 "uri-hash" => ["UNIQUE", "uri-hash"],
670 "uri" => ["uri(191)"],
671 "uri-id" => ["uri-id"]
675 "comment" => "Content for all posts",
677 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
678 "uri" => ["type" => "varchar(255)", "comment" => ""],
679 "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
680 "uri-plink-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
681 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "item title"],
682 "content-warning" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
683 "body" => ["type" => "mediumtext", "comment" => "item body content"],
684 "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "text location where this item originated"],
685 "coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "longitude/latitude pair representing location where this item originated"],
686 "language" => ["type" => "text", "comment" => "Language information about this post"],
687 "app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "application which generated this item"],
688 "rendered-hash" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
689 "rendered-html" => ["type" => "mediumtext", "comment" => "item.body converted to html"],
690 "object-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams object type"],
691 "object" => ["type" => "text", "comment" => "JSON encoded object structure unless it is an implied object (normal post)"],
692 "target-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams target type if applicable (URI)"],
693 "target" => ["type" => "text", "comment" => "JSON encoded target structure if used"],
694 "plink" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "permalink or URL to a displayable copy of the message at its source"],
695 "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams verb"]
699 "uri-plink-hash" => ["UNIQUE", "uri-plink-hash"],
700 "uri" => ["uri(191)"],
701 "uri-id" => ["uri-id"]
704 "item-delivery-data" => [
705 "comment" => "Delivery data for items",
707 "iid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["item" => "id"], "comment" => "Item id"],
708 "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"],
709 "inform" => ["type" => "mediumtext", "comment" => "Additional receivers of the linked item"],
712 "PRIMARY" => ["iid"],
716 "comment" => "URI and GUID for items",
718 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
719 "uri" => ["type" => "varbinary(255)", "not null" => "1", "comment" => "URI of an item"],
720 "guid" => ["type" => "varbinary(255)", "comment" => "A unique identifier for an item"]
724 "uri" => ["UNIQUE", "uri"],
731 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
732 "name" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => ""],
733 "locked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
734 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process ID"],
735 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
739 "name_expires" => ["name", "expires"]
743 "comment" => "private messages",
745 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
746 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
747 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this private message"],
748 "from-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "name of the sender"],
749 "from-photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "contact photo link of the sender"],
750 "from-url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "profile linke of the sender"],
751 "contact-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "relation" => ["contact" => "id"], "comment" => "contact.id"],
752 "convid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["conv" => "id"], "comment" => "conv.id"],
753 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
754 "body" => ["type" => "mediumtext", "comment" => ""],
755 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if message visited it is 1"],
756 "reply" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
757 "replied" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
758 "unknown" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if sender not in the contact table this is 1"],
759 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
760 "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
761 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time of the private message"],
765 "uid_seen" => ["uid", "seen"],
766 "convid" => ["convid"],
767 "uri" => ["uri(64)"],
768 "parent-uri" => ["parent-uri(64)"],
769 "contactid" => ["contact-id(32)"],
773 "comment" => "Mail account data for fetching mails",
775 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
776 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
777 "server" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
778 "port" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
779 "ssltype" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
780 "mailbox" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
781 "user" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
782 "pass" => ["type" => "text", "comment" => ""],
783 "reply_to" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
784 "action" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
785 "movetofolder" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
786 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
787 "last_check" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
794 "comment" => "table of accounts that can manage each other",
796 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
797 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
798 "mid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
802 "uid_mid" => ["UNIQUE", "uid", "mid"],
806 "comment" => "notifications",
808 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
809 "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => ""],
810 "type" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
811 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
812 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
813 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
814 "date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
815 "msg" => ["type" => "mediumtext", "comment" => ""],
816 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
817 "link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
818 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id"],
819 "parent" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
820 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
821 "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""],
822 "otype" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => ""],
823 "name_cache" => ["type" => "tinytext", "comment" => "Cached bbcode parsing of name"],
824 "msg_cache" => ["type" => "mediumtext", "comment" => "Cached bbcode parsing of msg"]
828 "hash_uid" => ["hash", "uid"],
829 "seen_uid_date" => ["seen", "uid", "date"],
830 "uid_date" => ["uid", "date"],
831 "uid_type_link" => ["uid", "type", "link(190)"],
834 "notify-threads" => [
837 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
838 "notify-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["notify" => "id"], "comment" => ""],
839 "master-parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"],
841 "parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
842 "receiver-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"],
843 "comment" => "User id"],
850 "comment" => "cache for OEmbed queries",
852 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
853 "maxwidth" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "comment" => "Maximum width passed to Oembed"],
854 "content" => ["type" => "mediumtext", "comment" => "OEmbed data of the page"],
855 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
858 "PRIMARY" => ["url", "maxwidth"],
859 "created" => ["created"],
862 "openwebauth-token" => [
863 "comment" => "Store OpenWebAuth token to verify contacts",
865 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
866 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
867 "type" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Verify type"],
868 "token" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A generated token"],
869 "meta" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
870 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
877 "comment" => "cache for 'parse_url' queries",
879 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
880 "guessing" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the 'guessing' mode active?"],
881 "oembed" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the data the result of oembed?"],
882 "content" => ["type" => "mediumtext", "comment" => "page data"],
883 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
886 "PRIMARY" => ["url", "guessing", "oembed"],
887 "created" => ["created"],
891 "comment" => "Storage for participation messages from Diaspora",
893 "iid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["item" => "id"], "comment" => ""],
894 "server" => ["type" => "varchar(60)", "not null" => "1", "primary" => "1", "comment" => ""],
895 "cid" => ["type" => "int unsigned", "not null" => "1", "relation" => ["contact" => "id"], "comment" => ""],
896 "fid" => ["type" => "int unsigned", "not null" => "1", "relation" => ["fcontact" => "id"], "comment" => ""],
899 "PRIMARY" => ["iid", "server"],
905 "comment" => "personal (per user) configuration storage",
907 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
908 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
909 "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
910 "k" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => ""],
911 "v" => ["type" => "mediumtext", "comment" => ""],
915 "uid_cat_k" => ["UNIQUE", "uid", "cat", "k"],
921 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
922 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner id of this permission set"],
923 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
924 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
925 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
926 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
930 "uid_allow_cid_allow_gid_deny_cid_deny_gid" => ["allow_cid(50)", "allow_gid(30)", "deny_cid(50)", "deny_gid(30)"],
934 "comment" => "photo storage",
936 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
937 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
938 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
939 "guid" => ["type" => "char(16)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this photo"],
940 "resource-id" => ["type" => "char(32)", "not null" => "1", "default" => "", "comment" => ""],
941 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation date"],
942 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edited date"],
943 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
944 "desc" => ["type" => "text", "comment" => ""],
945 "album" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "The name of the album to which the photo belongs"],
946 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
947 "type" => ["type" => "varchar(30)", "not null" => "1", "default" => "image/jpeg"],
948 "height" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
949 "width" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
950 "datasize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
951 "data" => ["type" => "mediumblob", "not null" => "1", "comment" => ""],
952 "scale" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
953 "profile" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
954 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
955 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
956 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
957 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
958 "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
959 "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"]
963 "contactid" => ["contact-id"],
964 "uid_contactid" => ["uid", "contact-id"],
965 "uid_profile" => ["uid", "profile"],
966 "uid_album_scale_created" => ["uid", "album(32)", "scale", "created"],
967 "uid_album_resource-id_created" => ["uid", "album(32)", "resource-id", "created"],
968 "resource-id" => ["resource-id"],
972 "comment" => "Currently unused table for storing poll results",
974 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
975 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
976 "q0" => ["type" => "text", "comment" => ""],
977 "q1" => ["type" => "text", "comment" => ""],
978 "q2" => ["type" => "text", "comment" => ""],
979 "q3" => ["type" => "text", "comment" => ""],
980 "q4" => ["type" => "text", "comment" => ""],
981 "q5" => ["type" => "text", "comment" => ""],
982 "q6" => ["type" => "text", "comment" => ""],
983 "q7" => ["type" => "text", "comment" => ""],
984 "q8" => ["type" => "text", "comment" => ""],
985 "q9" => ["type" => "text", "comment" => ""],
993 "comment" => "data for polls - currently unused",
995 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
996 "poll_id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["poll" => "id"]],
997 "choice" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1000 "PRIMARY" => ["id"],
1001 "poll_id" => ["poll_id"],
1005 "comment" => "Currently running system processes",
1007 "pid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "comment" => ""],
1008 "command" => ["type" => "varbinary(32)", "not null" => "1", "default" => "", "comment" => ""],
1009 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1012 "PRIMARY" => ["pid"],
1013 "command" => ["command"],
1017 "comment" => "user profiles data",
1019 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1020 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
1021 "profile-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name of the profile"],
1022 "is-default" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Mark this profile as default profile"],
1023 "hide-friends" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide friend list from viewers of this profile"],
1024 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1025 "pdesc" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Title or description"],
1026 "dob" => ["type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00", "comment" => "Day of birth"],
1027 "address" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1028 "locality" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1029 "region" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1030 "postal-code" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1031 "country-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1032 "hometown" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1033 "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1034 "marital" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1035 "with" => ["type" => "text", "comment" => ""],
1036 "howlong" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1037 "sexual" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1038 "politic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1039 "religion" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1040 "pub_keywords" => ["type" => "text", "comment" => ""],
1041 "prv_keywords" => ["type" => "text", "comment" => ""],
1042 "likes" => ["type" => "text", "comment" => ""],
1043 "dislikes" => ["type" => "text", "comment" => ""],
1044 "about" => ["type" => "text", "comment" => ""],
1045 "summary" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1046 "music" => ["type" => "text", "comment" => ""],
1047 "book" => ["type" => "text", "comment" => ""],
1048 "tv" => ["type" => "text", "comment" => ""],
1049 "film" => ["type" => "text", "comment" => ""],
1050 "interest" => ["type" => "text", "comment" => ""],
1051 "romance" => ["type" => "text", "comment" => ""],
1052 "work" => ["type" => "text", "comment" => ""],
1053 "education" => ["type" => "text", "comment" => ""],
1054 "contact" => ["type" => "text", "comment" => ""],
1055 "homepage" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1056 "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1057 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1058 "thumb" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1059 "publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish default profile in local directory"],
1060 "net-publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish profile in global directory"],
1063 "PRIMARY" => ["id"],
1064 "uid_is-default" => ["uid", "is-default"],
1065 "pub_keywords" => ["FULLTEXT", "pub_keywords"],
1068 "profile_check" => [
1069 "comment" => "DFRN remote auth use",
1071 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1072 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1073 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
1074 "dfrn_id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1075 "sec" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1076 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1079 "PRIMARY" => ["id"],
1082 "push_subscriber" => [
1083 "comment" => "Used for OStatus: Contains feed subscribers",
1085 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1086 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1087 "callback_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1088 "topic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1089 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1090 "push" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1091 "last_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last successful trial"],
1092 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1093 "renewed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last subscription renewal"],
1094 "secret" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1097 "PRIMARY" => ["id"],
1098 "next_try" => ["next_try"],
1102 "comment" => "Queue for messages that couldn't be delivered",
1104 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1105 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Message receiver"],
1106 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Receiver's network"],
1107 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Unique GUID of the message"],
1108 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date, when the message was created"],
1109 "last" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last trial"],
1110 "next" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1111 "retrial" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1112 "content" => ["type" => "mediumtext", "comment" => ""],
1113 "batch" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1116 "PRIMARY" => ["id"],
1122 "comment" => "registrations requiring admin approval",
1124 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1125 "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1126 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1127 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1128 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1129 "language" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
1130 "note" => ["type" => "text", "comment" => ""],
1133 "PRIMARY" => ["id"],
1139 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1140 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1141 "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1144 "PRIMARY" => ["id"],
1149 "comment" => "web session storage",
1151 "id" => ["type" => "bigint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1152 "sid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
1153 "data" => ["type" => "text", "comment" => ""],
1154 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1157 "PRIMARY" => ["id"],
1158 "sid" => ["sid(64)"],
1159 "expire" => ["expire"],
1163 "comment" => "Diaspora signatures",
1165 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1166 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id"],
1167 "signed_text" => ["type" => "mediumtext", "comment" => ""],
1168 "signature" => ["type" => "text", "comment" => ""],
1169 "signer" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1172 "PRIMARY" => ["id"],
1173 "iid" => ["UNIQUE", "iid"],
1177 "comment" => "item taxonomy (categories, tags, etc.) table",
1179 "tid" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
1180 "oid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
1181 "otype" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1182 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1183 "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1184 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1185 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1186 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1187 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1188 "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1189 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1192 "PRIMARY" => ["tid"],
1193 "oid_otype_type_term" => ["oid", "otype", "type", "term(32)"],
1194 "uid_otype_type_term_global_created" => ["uid", "otype", "type", "term(32)", "global", "created"],
1195 "uid_otype_type_url" => ["uid", "otype", "type", "url(64)"],
1196 "guid" => ["guid(64)"],
1200 "comment" => "Thread related data",
1202 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"],
1203 "comment" => "sequential ID"],
1204 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1205 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
1206 "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item owner"],
1207 "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item author"],
1208 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1209 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1210 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1211 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1212 "changed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1213 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1214 "private" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1215 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1216 "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1217 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1218 "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1219 "ignored" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1220 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"],
1221 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
1222 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1223 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1224 "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1225 "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1226 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
1227 "bookmark" => ["type" => "boolean", "comment" => ""],
1230 "PRIMARY" => ["iid"],
1231 "uid_network_commented" => ["uid", "network", "commented"],
1232 "uid_network_created" => ["uid", "network", "created"],
1233 "uid_contactid_commented" => ["uid", "contact-id", "commented"],
1234 "uid_contactid_created" => ["uid", "contact-id", "created"],
1235 "contactid" => ["contact-id"],
1236 "ownerid" => ["owner-id"],
1237 "authorid" => ["author-id"],
1238 "uid_created" => ["uid", "created"],
1239 "uid_commented" => ["uid", "commented"],
1240 "uid_wall_created" => ["uid", "wall", "created"],
1241 "private_wall_origin_commented" => ["private", "wall", "origin", "commented"],
1245 "comment" => "OAuth usage",
1247 "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""],
1248 "secret" => ["type" => "text", "comment" => ""],
1249 "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "relation" => ["clients" => "client_id"]],
1250 "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
1251 "scope" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
1252 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1255 "PRIMARY" => ["id"],
1259 "comment" => "The local users",
1261 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1262 "parent-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"],
1263 "comment" => "The parent user that has full control about this user"],
1264 "guid" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this user"],
1265 "username" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this user is known by"],
1266 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "encrypted password"],
1267 "legacy_password" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the password hash double-hashed?"],
1268 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "nick- and user name"],
1269 "email" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "the users email address"],
1270 "openid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1271 "timezone" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => "PHP-legal timezone"],
1272 "language" => ["type" => "varchar(32)", "not null" => "1", "default" => "en", "comment" => "default language"],
1273 "register_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of registration"],
1274 "login_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last login"],
1275 "default-location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Default for item.location"],
1276 "allow_location" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 allows to display the location"],
1277 "theme" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "user theme preference"],
1278 "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
1279 "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
1280 "spubkey" => ["type" => "text", "comment" => ""],
1281 "sprvkey" => ["type" => "text", "comment" => ""],
1282 "verified" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "user is verified through email"],
1283 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 for user is blocked"],
1284 "blockwall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to post to the profile page of the user"],
1285 "hidewall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide profile details from unkown viewers"],
1286 "blocktags" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to tag the post of this user"],
1287 "unkmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Permit unknown people to send private mails to this user"],
1288 "cntunkmail" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
1289 "notify-flags" => ["type" => "smallint unsigned", "not null" => "1", "default" => "65535", "comment" => "email notification options"],
1290 "page-flags" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "page/profile type"],
1291 "account-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1292 "prvnets" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1293 "pwdreset" => ["type" => "varchar(255)", "comment" => "Password reset request token"],
1294 "pwdreset_time" => ["type" => "datetime", "comment" => "Timestamp of the last password reset request"],
1295 "maxreq" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
1296 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1297 "account_removed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if 1 the account is removed"],
1298 "account_expired" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1299 "account_expires_on" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp when account expires and will be deleted"],
1300 "expire_notification_sent" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last warning of account expiration"],
1301 "def_gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1302 "allow_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1303 "allow_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1304 "deny_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1305 "deny_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1306 "openidserver" => ["type" => "text", "comment" => ""],
1309 "PRIMARY" => ["uid"],
1310 "nickname" => ["nickname(32)"],
1314 "comment" => "Deleted usernames",
1316 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1317 "username" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
1320 "PRIMARY" => ["id"],
1321 "username" => ["username(32)"],
1325 "comment" => "User specific public contact data",
1327 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["contact" => "id"], "comment" => "Contact id of the linked public contact"],
1328 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
1329 "blocked" => ["type" => "boolean", "comment" => "Contact is completely blocked for this user"],
1330 "ignored" => ["type" => "boolean", "comment" => "Posts from this contact are ignored"],
1331 "collapsed" => ["type" => "boolean", "comment" => "Posts from this contact are collapsed"]
1334 "PRIMARY" => ["uid", "cid"]
1338 "comment" => "User specific item data",
1340 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"], "comment" => "Item id"],
1341 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
1342 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide an item from the user"],
1343 "ignored" => ["type" => "boolean", "comment" => "Ignore this thread if set"]
1346 "PRIMARY" => ["uid", "iid"]
1350 "comment" => "Inter process communication between the frontend and the worker",
1352 "key" => ["type" => "int", "not null" => "1", "primary" => "1", "comment" => ""],
1353 "jobs" => ["type" => "boolean", "comment" => "Flag for outstanding jobs"],
1356 "PRIMARY" => ["key"],
1358 "engine" => "MEMORY",
1361 "comment" => "Background tasks queue entries",
1363 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented worker task id"],
1364 "parameter" => ["type" => "mediumblob", "comment" => "Task command"],
1365 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Task priority"],
1366 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date"],
1367 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process id of the worker"],
1368 "executed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Execution date"],
1369 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1370 "retrial" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1371 "done" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marked 1 when the task was done - will be deleted later"],
1374 "PRIMARY" => ["id"],
1376 "parameter" => ["parameter(64)"],
1377 "priority_created_next_try" => ["priority", "created", "next_try"],
1378 "done_priority_executed_next_try" => ["done", "priority", "executed", "next_try"],
1379 "done_executed_next_try" => ["done", "executed", "next_try"],
1380 "done_priority_next_try" => ["done", "priority", "next_try"],
1381 "done_next_try" => ["done", "next_try"]
1385 "comment" => "Data stored by Database storage backend",
1387 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented image data id"],
1388 "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"]