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', 1289);
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 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
69 "name" => ["type" => "varchar(255)", "comment" => ""],
70 "about" => ["type" => "text", "comment" => ""],
71 "photo" => ["type" => "varchar(255)", "comment" => ""],
72 "addr" => ["type" => "varchar(255)", "comment" => ""],
73 "alias" => ["type" => "varchar(255)", "comment" => ""],
74 "pubkey" => ["type" => "text", "comment" => ""],
75 "baseurl" => ["type" => "varchar(255)", "comment" => "baseurl of the ap contact"],
76 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
80 "addr" => ["addr(32)"],
81 "alias" => ["alias(190)"],
82 "url" => ["followers(190)"]
86 "comment" => "file attachments",
88 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "generated index"],
89 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
90 "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "hash"],
91 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "filename of original"],
92 "filetype" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "mimetype"],
93 "filesize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "size in bytes"],
94 "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"],
95 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
96 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
97 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>"],
98 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
99 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
100 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
107 "comment" => "OAuth usage",
109 "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""],
110 "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "relation" => ["clients" => "client_id"],
112 "redirect_uri" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
113 "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
114 "scope" => ["type" => "varchar(250)", "not null" => "1", "default" => "", "comment" => ""],
121 "comment" => "Stores temporary data",
123 "k" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "cache key"],
124 "v" => ["type" => "mediumtext", "comment" => "cached serialized value"],
125 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
126 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache insertion"],
130 "k_expires" => ["k", "expires"],
136 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
137 "challenge" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
138 "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
139 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
140 "type" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
141 "last_update" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
148 "comment" => "OAuth usage",
150 "client_id" => ["type" => "varchar(20)", "not null" => "1", "primary" => "1", "comment" => ""],
151 "pw" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => ""],
152 "redirect_uri" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
153 "name" => ["type" => "text", "comment" => ""],
154 "icon" => ["type" => "text", "comment" => ""],
155 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
158 "PRIMARY" => ["client_id"],
162 "comment" => "main configuration storage",
164 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
165 "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
166 "k" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
167 "v" => ["type" => "mediumtext", "comment" => ""],
171 "cat_k" => ["UNIQUE", "cat", "k"],
175 "comment" => "contact table",
177 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
178 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
179 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
180 "self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if the contact is the user him/her self"],
181 "remote_self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
182 "rel" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "The kind of the relation between the user and the contact"],
183 "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
184 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network protocol of the contact"],
185 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"],
186 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"],
187 "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
188 "about" => ["type" => "text", "comment" => ""],
189 "keywords" => ["type" => "text", "comment" => "public keywords (interests) of the contact"],
190 "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
191 "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
192 "attag" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
193 "avatar" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
194 "photo" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo of the contact"],
195 "thumb" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (thumb size)"],
196 "micro" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (micro size)"],
197 "site-pubkey" => ["type" => "text", "comment" => ""],
198 "issued-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
199 "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
200 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
201 "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
202 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
203 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
204 "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
205 "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
206 "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
207 "request" => ["type" => "varchar(255)", "comment" => ""],
208 "notify" => ["type" => "varchar(255)", "comment" => ""],
209 "poll" => ["type" => "varchar(255)", "comment" => ""],
210 "confirm" => ["type" => "varchar(255)", "comment" => ""],
211 "poco" => ["type" => "varchar(255)", "comment" => ""],
212 "aes_allow" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
213 "ret-aes" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
214 "usehub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
215 "subhub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
216 "hub-verify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
217 "last-update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last try to update the contact info"],
218 "success_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful contact update"],
219 "failure_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed update"],
220 "name-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
221 "uri-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
222 "avatar-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
223 "term-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
224 "last-item" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "date of the last post"],
225 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
226 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
227 "readonly" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "posts of the contact are readonly"],
228 "writable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
229 "forum" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a forum"],
230 "prv" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a private group"],
231 "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
232 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
233 "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
234 "pending" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
235 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact has been deleted"],
236 "rating" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
237 "reason" => ["type" => "text", "comment" => ""],
238 "closeness" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "99", "comment" => ""],
239 "info" => ["type" => "mediumtext", "comment" => ""],
240 "profile-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
241 "bdyear" => ["type" => "varchar(4)", "not null" => "1", "default" => "", "comment" => ""],
242 "bd" => ["type" => "date", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""],
243 "notify_new_posts" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
244 "fetch_further_information" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
245 "ffi_keyword_blacklist" => ["type" => "text", "comment" => ""],
249 "uid_name" => ["uid", "name(190)"],
250 "self_uid" => ["self", "uid"],
251 "alias_uid" => ["alias(32)", "uid"],
252 "pending_uid" => ["pending", "uid"],
253 "blocked_uid" => ["blocked", "uid"],
254 "uid_rel_network_poll" => ["uid", "rel", "network", "poll(64)", "archive"],
255 "uid_network_batch" => ["uid", "network", "batch(64)"],
256 "addr_uid" => ["addr(32)", "uid"],
257 "nurl_uid" => ["nurl(32)", "uid"],
258 "nick_uid" => ["nick(32)", "uid"],
259 "dfrn-id" => ["dfrn-id(64)"],
260 "issued-id" => ["issued-id(64)"],
264 "comment" => "private messages",
266 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
267 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this conversation"],
268 "recips" => ["type" => "text", "comment" => "sender_handle;recipient_handle"],
269 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
270 "creator" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "handle of creator"],
271 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation timestamp"],
272 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "edited timestamp"],
273 "subject" => ["type" => "text", "comment" => "subject of initial message"],
281 "comment" => "Raw data and structure information for messages",
283 "item-uri" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "Original URI of the item - unrelated to the table with the same name"],
284 "reply-to-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "URI to which this item is a reply"],
285 "conversation-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation URI"],
286 "conversation-href" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation link"],
287 "protocol" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "255", "comment" => "The protocol of the item"],
288 "source" => ["type" => "mediumtext", "comment" => "Original source"],
289 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Receiving date"],
292 "PRIMARY" => ["item-uri"],
293 "conversation-uri" => ["conversation-uri"],
294 "received" => ["received"],
297 "diaspora-interaction" => [
298 "comment" => "Signed Diaspora Interaction",
300 "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"],
301 "interaction" => ["type" => "mediumtext", "comment" => "The Diaspora interaction"]
304 "PRIMARY" => ["uri-id"]
308 "comment" => "Events",
310 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
311 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
312 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
313 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact_id (ID of the contact in contact table)"],
314 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
315 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
316 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
317 "start" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event start time"],
318 "finish" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event end time"],
319 "summary" => ["type" => "text", "comment" => "short description or title of the event"],
320 "desc" => ["type" => "text", "comment" => "event description"],
321 "location" => ["type" => "text", "comment" => "event location"],
322 "type" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => "event or birthday"],
323 "nofinish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if event does have no end this is 1"],
324 "adjust" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "adjust to timezone of the recipient (0 or 1)"],
325 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "0 or 1"],
326 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
327 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
328 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
329 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
333 "uid_start" => ["uid", "start"],
337 "comment" => "Diaspora compatible contacts - used in the Diaspora implementation",
339 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
340 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "unique id"],
341 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
342 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
343 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
344 "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
345 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
346 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
347 "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
348 "notify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
349 "poll" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
350 "confirm" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
351 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
352 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
353 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
354 "pubkey" => ["type" => "text", "comment" => ""],
355 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
359 "addr" => ["addr(32)"],
360 "url" => ["UNIQUE", "url(190)"],
364 "comment" => "friend suggestion stuff",
366 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
367 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
368 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
369 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
370 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
371 "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
372 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
373 "note" => ["type" => "text", "comment" => ""],
374 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
381 "comment" => "contacts ignored by friend suggestions",
383 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
384 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Local User id"],
385 "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => "gcontact.id of ignored contact"],
394 "comment" => "global contacts",
396 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
397 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"],
398 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"],
399 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the contacts profile page"],
400 "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
401 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the profile photo"],
402 "connect" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
403 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
404 "updated" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
405 "last_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
406 "last_failure" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
407 "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
408 "about" => ["type" => "text", "comment" => ""],
409 "keywords" => ["type" => "text", "comment" => "puplic keywords (interests)"],
410 "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
411 "birthday" => ["type" => "varchar(32)", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""],
412 "community" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if contact is forum account"],
413 "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "-1", "comment" => ""],
414 "hide" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = should be hidden from search"],
415 "nsfw" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = contact posts nsfw content"],
416 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "social network protocol"],
417 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
418 "notify" => ["type" => "varchar(255)", "comment" => ""],
419 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
420 "generation" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
421 "server_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "baseurl of the contacts server"],
425 "nurl" => ["UNIQUE", "nurl(190)"],
426 "name" => ["name(64)"],
427 "nick" => ["nick(32)"],
428 "addr" => ["addr(64)"],
429 "hide_network_updated" => ["hide", "network", "updated"],
430 "updated" => ["updated"],
434 "comment" => "'friends of friends' linkages derived from poco",
436 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
437 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
438 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
439 "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
440 "zcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
441 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
445 "cid_uid_gcid_zcid" => ["UNIQUE", "cid", "uid", "gcid", "zcid"],
450 "comment" => "privacy groups, group info",
452 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
453 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
454 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the member list is not private"],
455 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the group has been deleted"],
456 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "human readable name of group"],
464 "comment" => "privacy groups, member info",
466 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
467 "gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["group" => "id"], "comment" => "groups.id of the associated group"],
468 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id of the member assigned to the associated group"],
472 "contactid" => ["contact-id"],
473 "gid_contactid" => ["UNIQUE", "gid", "contact-id"],
477 "comment" => "Global servers",
479 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
480 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
481 "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
482 "version" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
483 "site_name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
484 "info" => ["type" => "text", "comment" => ""],
485 "register_policy" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
486 "registered-users" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Number of registered users"],
487 "poco" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
488 "noscrape" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
489 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
490 "platform" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
491 "relay-subscribe" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Has the server subscribed to the relay system"],
492 "relay-scope" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => "The scope of messages that the server wants to get"],
493 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
494 "last_poco_query" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
495 "last_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
496 "last_failure" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
500 "nurl" => ["UNIQUE", "nurl(190)"],
504 "comment" => "Tags that the server has subscribed",
506 "gserver-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gserver" => "id"], "primary" => "1",
507 "comment" => "The id of the gserver"],
508 "tag" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "primary" => "1", "comment" => "Tag that the server has subscribed"],
511 "PRIMARY" => ["gserver-id", "tag"],
516 "comment" => "addon hook registry",
518 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
519 "hook" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => "name of hook"],
520 "file" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "relative filename of hook handler"],
521 "function" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "function name of hook handler"],
522 "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"],
526 "hook_file_function" => ["UNIQUE", "hook", "file", "function"],
532 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
533 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
534 "fid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["fcontact" => "id"], "comment" => ""],
535 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
536 "knowyou" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
537 "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
538 "note" => ["type" => "text", "comment" => ""],
539 "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
540 "datetime" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
541 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
542 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
549 "comment" => "Structure for all posts",
551 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
552 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this item"],
553 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
554 "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
555 "uri-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
556 "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"],
557 "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "uri of the parent to this item"],
558 "parent-uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the parent uri"],
559 "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"],
560 "thr-parent-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"],
561 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation timestamp."],
562 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last edit (default is created)"],
563 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last comment/reply to this item"],
564 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime"],
565 "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"],
566 "gravity" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
567 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network from where the item comes from"],
568 "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"],
569 "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"],
570 "icid" => ["type" => "int unsigned", "relation" => ["item-content" => "id"], "comment" => "Id of the item-content table entry that contains the whole item content"],
571 "iaid" => ["type" => "int unsigned", "relation" => ["item-activity" => "id"], "comment" => "Id of the item-activity table entry that contains the activity data"],
572 "extid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
573 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"],
574 "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
575 "private" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "distribution is restricted"],
576 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
577 "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
578 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been deleted"],
579 // User specific fields. Eventually they will move to user-item
580 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
581 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
582 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "This item was posted to the wall of uid"],
583 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item originated at this site"],
584 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
585 "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been favourited"],
586 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "item has not been seen"],
587 "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "The owner of this item was mentioned in it"],
588 "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
589 "psid" => ["type" => "int unsigned", "relation" => ["permissionset" => "id"], "comment" => "ID of the permission set of this post"],
590 // It has to be decided whether these fields belong to the user or the structure
591 "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"],
592 "event-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["event" => "id"], "comment" => "Used to link to the event.id"],
593 // Could possibly be replaced by the "attach" table?
594 "attach" => ["type" => "mediumtext", "comment" => "JSON structure representing attachments to this item"],
595 // Deprecated fields. Will be removed in upcoming versions
596 "allow_cid" => ["type" => "mediumtext", "comment" => "Deprecated"],
597 "allow_gid" => ["type" => "mediumtext", "comment" => "Deprecated"],
598 "deny_cid" => ["type" => "mediumtext", "comment" => "Deprecated"],
599 "deny_gid" => ["type" => "mediumtext", "comment" => "Deprecated"],
600 "postopts" => ["type" => "text", "comment" => "Deprecated"],
601 "inform" => ["type" => "mediumtext", "comment" => "Deprecated"],
602 "type" => ["type" => "varchar(20)", "comment" => "Deprecated"],
603 "bookmark" => ["type" => "boolean", "comment" => "Deprecated"],
604 "file" => ["type" => "mediumtext", "comment" => "Deprecated"],
605 "location" => ["type" => "varchar(255)", "comment" => "Deprecated"],
606 "coord" => ["type" => "varchar(255)", "comment" => "Deprecated"],
607 "tag" => ["type" => "mediumtext", "comment" => "Deprecated"],
608 "plink" => ["type" => "varchar(255)", "comment" => "Deprecated"],
609 "title" => ["type" => "varchar(255)", "comment" => "Deprecated"],
610 "content-warning" => ["type" => "varchar(255)", "comment" => "Deprecated"],
611 "body" => ["type" => "mediumtext", "comment" => "Deprecated"],
612 "app" => ["type" => "varchar(255)", "comment" => "Deprecated"],
613 "verb" => ["type" => "varchar(100)", "comment" => "Deprecated"],
614 "object-type" => ["type" => "varchar(100)", "comment" => "Deprecated"],
615 "object" => ["type" => "text", "comment" => "Deprecated"],
616 "target-type" => ["type" => "varchar(100)", "comment" => "Deprecated"],
617 "target" => ["type" => "text", "comment" => "Deprecated"],
618 "author-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
619 "author-link" => ["type" => "varchar(255)", "comment" => "Deprecated"],
620 "author-avatar" => ["type" => "varchar(255)", "comment" => "Deprecated"],
621 "owner-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
622 "owner-link" => ["type" => "varchar(255)", "comment" => "Deprecated"],
623 "owner-avatar" => ["type" => "varchar(255)", "comment" => "Deprecated"],
624 "rendered-hash" => ["type" => "varchar(32)", "comment" => "Deprecated"],
625 "rendered-html" => ["type" => "mediumtext", "comment" => "Deprecated"],
629 "guid" => ["guid(191)"],
630 "uri" => ["uri(191)"],
631 "parent" => ["parent"],
632 "parent-uri" => ["parent-uri(191)"],
633 "extid" => ["extid(191)"],
634 "uid_id" => ["uid", "id"],
635 "uid_contactid_id" => ["uid", "contact-id", "id"],
636 "uid_created" => ["uid", "created"],
637 "uid_commented" => ["uid", "commented"],
638 "uid_unseen_contactid" => ["uid", "unseen", "contact-id"],
639 "uid_network_received" => ["uid", "network", "received"],
640 "uid_network_commented" => ["uid", "network", "commented"],
641 "uid_thrparent" => ["uid", "thr-parent(190)"],
642 "uid_parenturi" => ["uid", "parent-uri(190)"],
643 "uid_contactid_created" => ["uid", "contact-id", "created"],
644 "authorid_created" => ["author-id", "created"],
645 "ownerid" => ["owner-id"],
646 "uid_uri" => ["uid", "uri(190)"],
647 "resource-id" => ["resource-id"],
648 "deleted_changed" => ["deleted", "changed"],
649 "uid_wall_changed" => ["uid", "wall", "changed"],
650 "uid_eventid" => ["uid", "event-id"],
653 "psid_wall" => ["psid", "wall"],
657 "comment" => "Activities for items",
659 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
660 "uri" => ["type" => "varchar(255)", "comment" => ""],
661 "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
662 "uri-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
663 "activity" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""]
667 "uri-hash" => ["UNIQUE", "uri-hash"],
668 "uri" => ["uri(191)"],
669 "uri-id" => ["uri-id"]
673 "comment" => "Content for all posts",
675 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
676 "uri" => ["type" => "varchar(255)", "comment" => ""],
677 "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
678 "uri-plink-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
679 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "item title"],
680 "content-warning" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
681 "body" => ["type" => "mediumtext", "comment" => "item body content"],
682 "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "text location where this item originated"],
683 "coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "longitude/latitude pair representing location where this item originated"],
684 "language" => ["type" => "text", "comment" => "Language information about this post"],
685 "app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "application which generated this item"],
686 "rendered-hash" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
687 "rendered-html" => ["type" => "mediumtext", "comment" => "item.body converted to html"],
688 "object-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams object type"],
689 "object" => ["type" => "text", "comment" => "JSON encoded object structure unless it is an implied object (normal post)"],
690 "target-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams target type if applicable (URI)"],
691 "target" => ["type" => "text", "comment" => "JSON encoded target structure if used"],
692 "plink" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "permalink or URL to a displayable copy of the message at its source"],
693 "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams verb"]
697 "uri-plink-hash" => ["UNIQUE", "uri-plink-hash"],
698 "uri" => ["uri(191)"],
699 "uri-id" => ["uri-id"]
702 "item-delivery-data" => [
703 "comment" => "Delivery data for items",
705 "iid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["item" => "id"], "comment" => "Item id"],
706 "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"],
707 "inform" => ["type" => "mediumtext", "comment" => "Additional receivers of the linked item"],
710 "PRIMARY" => ["iid"],
714 "comment" => "URI and GUID for items",
716 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
717 "uri" => ["type" => "varbinary(255)", "not null" => "1", "comment" => "URI of an item"],
718 "guid" => ["type" => "varbinary(255)", "comment" => "A unique identifier for an item"]
722 "uri" => ["UNIQUE", "uri"],
729 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
730 "name" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => ""],
731 "locked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
732 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process ID"],
733 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
737 "name_expires" => ["name", "expires"]
741 "comment" => "private messages",
743 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
744 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
745 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this private message"],
746 "from-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "name of the sender"],
747 "from-photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "contact photo link of the sender"],
748 "from-url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "profile linke of the sender"],
749 "contact-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "relation" => ["contact" => "id"], "comment" => "contact.id"],
750 "convid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["conv" => "id"], "comment" => "conv.id"],
751 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
752 "body" => ["type" => "mediumtext", "comment" => ""],
753 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if message visited it is 1"],
754 "reply" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
755 "replied" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
756 "unknown" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if sender not in the contact table this is 1"],
757 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
758 "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
759 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time of the private message"],
763 "uid_seen" => ["uid", "seen"],
764 "convid" => ["convid"],
765 "uri" => ["uri(64)"],
766 "parent-uri" => ["parent-uri(64)"],
767 "contactid" => ["contact-id(32)"],
771 "comment" => "Mail account data for fetching mails",
773 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
774 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
775 "server" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
776 "port" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
777 "ssltype" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
778 "mailbox" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
779 "user" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
780 "pass" => ["type" => "text", "comment" => ""],
781 "reply_to" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
782 "action" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
783 "movetofolder" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
784 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
785 "last_check" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
792 "comment" => "table of accounts that can manage each other",
794 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
795 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
796 "mid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
800 "uid_mid" => ["UNIQUE", "uid", "mid"],
804 "comment" => "notifications",
806 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
807 "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => ""],
808 "type" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
809 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
810 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
811 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
812 "date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
813 "msg" => ["type" => "mediumtext", "comment" => ""],
814 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
815 "link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
816 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id"],
817 "parent" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
818 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
819 "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""],
820 "otype" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => ""],
821 "name_cache" => ["type" => "tinytext", "comment" => "Cached bbcode parsing of name"],
822 "msg_cache" => ["type" => "mediumtext", "comment" => "Cached bbcode parsing of msg"]
826 "hash_uid" => ["hash", "uid"],
827 "seen_uid_date" => ["seen", "uid", "date"],
828 "uid_date" => ["uid", "date"],
829 "uid_type_link" => ["uid", "type", "link(190)"],
832 "notify-threads" => [
835 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
836 "notify-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["notify" => "id"], "comment" => ""],
837 "master-parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"],
839 "parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
840 "receiver-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"],
841 "comment" => "User id"],
848 "comment" => "cache for OEmbed queries",
850 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
851 "maxwidth" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "comment" => "Maximum width passed to Oembed"],
852 "content" => ["type" => "mediumtext", "comment" => "OEmbed data of the page"],
853 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
856 "PRIMARY" => ["url", "maxwidth"],
857 "created" => ["created"],
860 "openwebauth-token" => [
861 "comment" => "Store OpenWebAuth token to verify contacts",
863 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
864 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
865 "type" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Verify type"],
866 "token" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A generated token"],
867 "meta" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
868 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
875 "comment" => "cache for 'parse_url' queries",
877 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
878 "guessing" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the 'guessing' mode active?"],
879 "oembed" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the data the result of oembed?"],
880 "content" => ["type" => "mediumtext", "comment" => "page data"],
881 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
884 "PRIMARY" => ["url", "guessing", "oembed"],
885 "created" => ["created"],
889 "comment" => "Storage for participation messages from Diaspora",
891 "iid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["item" => "id"], "comment" => ""],
892 "server" => ["type" => "varchar(60)", "not null" => "1", "primary" => "1", "comment" => ""],
893 "cid" => ["type" => "int unsigned", "not null" => "1", "relation" => ["contact" => "id"], "comment" => ""],
894 "fid" => ["type" => "int unsigned", "not null" => "1", "relation" => ["fcontact" => "id"], "comment" => ""],
897 "PRIMARY" => ["iid", "server"]
901 "comment" => "personal (per user) configuration storage",
903 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
904 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
905 "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
906 "k" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => ""],
907 "v" => ["type" => "mediumtext", "comment" => ""],
911 "uid_cat_k" => ["UNIQUE", "uid", "cat", "k"],
917 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
918 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner id of this permission set"],
919 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
920 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
921 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
922 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
926 "uid_allow_cid_allow_gid_deny_cid_deny_gid" => ["allow_cid(50)", "allow_gid(30)", "deny_cid(50)", "deny_gid(30)"],
930 "comment" => "photo storage",
932 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
933 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
934 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
935 "guid" => ["type" => "char(16)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this photo"],
936 "resource-id" => ["type" => "char(32)", "not null" => "1", "default" => "", "comment" => ""],
937 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation date"],
938 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edited date"],
939 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
940 "desc" => ["type" => "text", "comment" => ""],
941 "album" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "The name of the album to which the photo belongs"],
942 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
943 "type" => ["type" => "varchar(30)", "not null" => "1", "default" => "image/jpeg"],
944 "height" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
945 "width" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
946 "datasize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
947 "data" => ["type" => "mediumblob", "not null" => "1", "comment" => ""],
948 "scale" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
949 "profile" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
950 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
951 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
952 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
953 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
957 "contactid" => ["contact-id"],
958 "uid_contactid" => ["uid", "contact-id"],
959 "uid_profile" => ["uid", "profile"],
960 "uid_album_scale_created" => ["uid", "album(32)", "scale", "created"],
961 "uid_album_resource-id_created" => ["uid", "album(32)", "resource-id", "created"],
962 "resource-id" => ["resource-id"],
966 "comment" => "Currently unused table for storing poll results",
968 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
969 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
970 "q0" => ["type" => "text", "comment" => ""],
971 "q1" => ["type" => "text", "comment" => ""],
972 "q2" => ["type" => "text", "comment" => ""],
973 "q3" => ["type" => "text", "comment" => ""],
974 "q4" => ["type" => "text", "comment" => ""],
975 "q5" => ["type" => "text", "comment" => ""],
976 "q6" => ["type" => "text", "comment" => ""],
977 "q7" => ["type" => "text", "comment" => ""],
978 "q8" => ["type" => "text", "comment" => ""],
979 "q9" => ["type" => "text", "comment" => ""],
987 "comment" => "data for polls - currently unused",
989 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
990 "poll_id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["poll" => "id"]],
991 "choice" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
995 "poll_id" => ["poll_id"],
999 "comment" => "Currently running system processes",
1001 "pid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "comment" => ""],
1002 "command" => ["type" => "varbinary(32)", "not null" => "1", "default" => "", "comment" => ""],
1003 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1006 "PRIMARY" => ["pid"],
1007 "command" => ["command"],
1011 "comment" => "user profiles data",
1013 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1014 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
1015 "profile-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name of the profile"],
1016 "is-default" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Mark this profile as default profile"],
1017 "hide-friends" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide friend list from viewers of this profile"],
1018 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1019 "pdesc" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Title or description"],
1020 "dob" => ["type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00", "comment" => "Day of birth"],
1021 "address" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1022 "locality" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1023 "region" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1024 "postal-code" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1025 "country-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1026 "hometown" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1027 "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1028 "marital" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1029 "with" => ["type" => "text", "comment" => ""],
1030 "howlong" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1031 "sexual" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1032 "politic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1033 "religion" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1034 "pub_keywords" => ["type" => "text", "comment" => ""],
1035 "prv_keywords" => ["type" => "text", "comment" => ""],
1036 "likes" => ["type" => "text", "comment" => ""],
1037 "dislikes" => ["type" => "text", "comment" => ""],
1038 "about" => ["type" => "text", "comment" => ""],
1039 "summary" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1040 "music" => ["type" => "text", "comment" => ""],
1041 "book" => ["type" => "text", "comment" => ""],
1042 "tv" => ["type" => "text", "comment" => ""],
1043 "film" => ["type" => "text", "comment" => ""],
1044 "interest" => ["type" => "text", "comment" => ""],
1045 "romance" => ["type" => "text", "comment" => ""],
1046 "work" => ["type" => "text", "comment" => ""],
1047 "education" => ["type" => "text", "comment" => ""],
1048 "contact" => ["type" => "text", "comment" => ""],
1049 "homepage" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1050 "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1051 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1052 "thumb" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1053 "publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish default profile in local directory"],
1054 "net-publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish profile in global directory"],
1057 "PRIMARY" => ["id"],
1058 "uid_is-default" => ["uid", "is-default"],
1061 "profile_check" => [
1062 "comment" => "DFRN remote auth use",
1064 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1065 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1066 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
1067 "dfrn_id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1068 "sec" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1069 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1072 "PRIMARY" => ["id"],
1075 "push_subscriber" => [
1076 "comment" => "Used for OStatus: Contains feed subscribers",
1078 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1079 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1080 "callback_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1081 "topic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1082 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1083 "push" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1084 "last_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last successful trial"],
1085 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1086 "renewed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last subscription renewal"],
1087 "secret" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1090 "PRIMARY" => ["id"],
1091 "next_try" => ["next_try"],
1095 "comment" => "Queue for messages that couldn't be delivered",
1097 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1098 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Message receiver"],
1099 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Receiver's network"],
1100 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Unique GUID of the message"],
1101 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date, when the message was created"],
1102 "last" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last trial"],
1103 "next" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1104 "retrial" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1105 "content" => ["type" => "mediumtext", "comment" => ""],
1106 "batch" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1109 "PRIMARY" => ["id"],
1115 "comment" => "registrations requiring admin approval",
1117 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1118 "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1119 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1120 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1121 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1122 "language" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
1123 "note" => ["type" => "text", "comment" => ""],
1126 "PRIMARY" => ["id"],
1132 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1133 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1134 "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1137 "PRIMARY" => ["id"],
1142 "comment" => "web session storage",
1144 "id" => ["type" => "bigint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1145 "sid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
1146 "data" => ["type" => "text", "comment" => ""],
1147 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1150 "PRIMARY" => ["id"],
1151 "sid" => ["sid(64)"],
1152 "expire" => ["expire"],
1156 "comment" => "Diaspora signatures",
1158 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1159 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id"],
1160 "signed_text" => ["type" => "mediumtext", "comment" => ""],
1161 "signature" => ["type" => "text", "comment" => ""],
1162 "signer" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1165 "PRIMARY" => ["id"],
1166 "iid" => ["UNIQUE", "iid"],
1170 "comment" => "item taxonomy (categories, tags, etc.) table",
1172 "tid" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
1173 "oid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
1174 "otype" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1175 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1176 "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1177 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1178 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1179 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1180 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1181 "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1182 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1185 "PRIMARY" => ["tid"],
1186 "oid_otype_type_term" => ["oid", "otype", "type", "term(32)"],
1187 "uid_otype_type_term_global_created" => ["uid", "otype", "type", "term(32)", "global", "created"],
1188 "uid_otype_type_url" => ["uid", "otype", "type", "url(64)"],
1189 "guid" => ["guid(64)"],
1193 "comment" => "Thread related data",
1195 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"],
1196 "comment" => "sequential ID"],
1197 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1198 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
1199 "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item owner"],
1200 "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item author"],
1201 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1202 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1203 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1204 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1205 "changed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1206 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1207 "private" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1208 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1209 "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1210 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1211 "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1212 "ignored" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1213 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"],
1214 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
1215 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1216 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1217 "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1218 "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1219 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
1220 "bookmark" => ["type" => "boolean", "comment" => ""],
1223 "PRIMARY" => ["iid"],
1224 "uid_network_commented" => ["uid", "network", "commented"],
1225 "uid_network_created" => ["uid", "network", "created"],
1226 "uid_contactid_commented" => ["uid", "contact-id", "commented"],
1227 "uid_contactid_created" => ["uid", "contact-id", "created"],
1228 "contactid" => ["contact-id"],
1229 "ownerid" => ["owner-id"],
1230 "authorid" => ["author-id"],
1231 "uid_created" => ["uid", "created"],
1232 "uid_commented" => ["uid", "commented"],
1233 "uid_wall_created" => ["uid", "wall", "created"],
1234 "private_wall_origin_commented" => ["private", "wall", "origin", "commented"],
1238 "comment" => "OAuth usage",
1240 "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""],
1241 "secret" => ["type" => "text", "comment" => ""],
1242 "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "relation" => ["clients" => "client_id"]],
1243 "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
1244 "scope" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
1245 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1248 "PRIMARY" => ["id"],
1252 "comment" => "The local users",
1254 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1255 "parent-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"],
1256 "comment" => "The parent user that has full control about this user"],
1257 "guid" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this user"],
1258 "username" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this user is known by"],
1259 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "encrypted password"],
1260 "legacy_password" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the password hash double-hashed?"],
1261 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "nick- and user name"],
1262 "email" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "the users email address"],
1263 "openid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1264 "timezone" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => "PHP-legal timezone"],
1265 "language" => ["type" => "varchar(32)", "not null" => "1", "default" => "en", "comment" => "default language"],
1266 "register_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of registration"],
1267 "login_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last login"],
1268 "default-location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Default for item.location"],
1269 "allow_location" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 allows to display the location"],
1270 "theme" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "user theme preference"],
1271 "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
1272 "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
1273 "spubkey" => ["type" => "text", "comment" => ""],
1274 "sprvkey" => ["type" => "text", "comment" => ""],
1275 "verified" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "user is verified through email"],
1276 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 for user is blocked"],
1277 "blockwall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to post to the profile page of the user"],
1278 "hidewall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide profile details from unkown viewers"],
1279 "blocktags" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to tag the post of this user"],
1280 "unkmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Permit unknown people to send private mails to this user"],
1281 "cntunkmail" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
1282 "notify-flags" => ["type" => "smallint unsigned", "not null" => "1", "default" => "65535", "comment" => "email notification options"],
1283 "page-flags" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "page/profile type"],
1284 "account-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1285 "prvnets" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1286 "pwdreset" => ["type" => "varchar(255)", "comment" => "Password reset request token"],
1287 "pwdreset_time" => ["type" => "datetime", "comment" => "Timestamp of the last password reset request"],
1288 "maxreq" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
1289 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1290 "account_removed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if 1 the account is removed"],
1291 "account_expired" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1292 "account_expires_on" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp when account expires and will be deleted"],
1293 "expire_notification_sent" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last warning of account expiration"],
1294 "def_gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1295 "allow_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1296 "allow_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1297 "deny_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1298 "deny_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1299 "openidserver" => ["type" => "text", "comment" => ""],
1302 "PRIMARY" => ["uid"],
1303 "nickname" => ["nickname(32)"],
1307 "comment" => "Deleted usernames",
1309 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1310 "username" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
1313 "PRIMARY" => ["id"],
1314 "username" => ["username(32)"],
1318 "comment" => "User specific public contact data",
1320 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["contact" => "id"], "comment" => "Contact id of the linked public contact"],
1321 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
1322 "blocked" => ["type" => "boolean", "comment" => "Contact is completely blocked for this user"],
1323 "ignored" => ["type" => "boolean", "comment" => "Posts from this contact are ignored"],
1324 "collapsed" => ["type" => "boolean", "comment" => "Posts from this contact are collapsed"]
1327 "PRIMARY" => ["uid", "cid"]
1331 "comment" => "User specific item data",
1333 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"], "comment" => "Item id"],
1334 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
1335 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide an item from the user"],
1336 "ignored" => ["type" => "boolean", "comment" => "Ignore this thread if set"]
1339 "PRIMARY" => ["uid", "iid"]
1343 "comment" => "Inter process communication between the frontend and the worker",
1345 "key" => ["type" => "int", "not null" => "1", "primary" => "1", "comment" => ""],
1346 "jobs" => ["type" => "boolean", "comment" => "Flag for outstanding jobs"],
1349 "PRIMARY" => ["key"],
1351 "engine" => "MEMORY",
1354 "comment" => "Background tasks queue entries",
1356 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented worker task id"],
1357 "parameter" => ["type" => "mediumblob", "comment" => "Task command"],
1358 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Task priority"],
1359 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date"],
1360 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process id of the worker"],
1361 "executed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Execution date"],
1362 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1363 "retrial" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1364 "done" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marked 1 when the task was done - will be deleted later"],
1367 "PRIMARY" => ["id"],
1369 "parameter" => ["parameter(64)"],
1370 "priority_created_next_try" => ["priority", "created", "next_try"],
1371 "done_executed_next_try" => ["done", "executed", "next_try"]