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', 1292);
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 "contact-id" => ["contact-id"],
647 "uid_uri" => ["uid", "uri(190)"],
648 "resource-id" => ["resource-id"],
649 "deleted_changed" => ["deleted", "changed"],
650 "uid_wall_changed" => ["uid", "wall", "changed"],
651 "uid_eventid" => ["uid", "event-id"],
654 "psid_wall" => ["psid", "wall"],
658 "comment" => "Activities for items",
660 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
661 "uri" => ["type" => "varchar(255)", "comment" => ""],
662 "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
663 "uri-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
664 "activity" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""]
668 "uri-hash" => ["UNIQUE", "uri-hash"],
669 "uri" => ["uri(191)"],
670 "uri-id" => ["uri-id"]
674 "comment" => "Content for all posts",
676 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
677 "uri" => ["type" => "varchar(255)", "comment" => ""],
678 "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
679 "uri-plink-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
680 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "item title"],
681 "content-warning" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
682 "body" => ["type" => "mediumtext", "comment" => "item body content"],
683 "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "text location where this item originated"],
684 "coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "longitude/latitude pair representing location where this item originated"],
685 "language" => ["type" => "text", "comment" => "Language information about this post"],
686 "app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "application which generated this item"],
687 "rendered-hash" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
688 "rendered-html" => ["type" => "mediumtext", "comment" => "item.body converted to html"],
689 "object-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams object type"],
690 "object" => ["type" => "text", "comment" => "JSON encoded object structure unless it is an implied object (normal post)"],
691 "target-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams target type if applicable (URI)"],
692 "target" => ["type" => "text", "comment" => "JSON encoded target structure if used"],
693 "plink" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "permalink or URL to a displayable copy of the message at its source"],
694 "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams verb"]
698 "uri-plink-hash" => ["UNIQUE", "uri-plink-hash"],
699 "uri" => ["uri(191)"],
700 "uri-id" => ["uri-id"]
703 "item-delivery-data" => [
704 "comment" => "Delivery data for items",
706 "iid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["item" => "id"], "comment" => "Item id"],
707 "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"],
708 "inform" => ["type" => "mediumtext", "comment" => "Additional receivers of the linked item"],
711 "PRIMARY" => ["iid"],
715 "comment" => "URI and GUID for items",
717 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
718 "uri" => ["type" => "varbinary(255)", "not null" => "1", "comment" => "URI of an item"],
719 "guid" => ["type" => "varbinary(255)", "comment" => "A unique identifier for an item"]
723 "uri" => ["UNIQUE", "uri"],
730 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
731 "name" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => ""],
732 "locked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
733 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process ID"],
734 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
738 "name_expires" => ["name", "expires"]
742 "comment" => "private messages",
744 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
745 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
746 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this private message"],
747 "from-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "name of the sender"],
748 "from-photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "contact photo link of the sender"],
749 "from-url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "profile linke of the sender"],
750 "contact-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "relation" => ["contact" => "id"], "comment" => "contact.id"],
751 "convid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["conv" => "id"], "comment" => "conv.id"],
752 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
753 "body" => ["type" => "mediumtext", "comment" => ""],
754 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if message visited it is 1"],
755 "reply" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
756 "replied" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
757 "unknown" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if sender not in the contact table this is 1"],
758 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
759 "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
760 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time of the private message"],
764 "uid_seen" => ["uid", "seen"],
765 "convid" => ["convid"],
766 "uri" => ["uri(64)"],
767 "parent-uri" => ["parent-uri(64)"],
768 "contactid" => ["contact-id(32)"],
772 "comment" => "Mail account data for fetching mails",
774 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
775 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
776 "server" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
777 "port" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
778 "ssltype" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
779 "mailbox" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
780 "user" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
781 "pass" => ["type" => "text", "comment" => ""],
782 "reply_to" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
783 "action" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
784 "movetofolder" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
785 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
786 "last_check" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
793 "comment" => "table of accounts that can manage each other",
795 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
796 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
797 "mid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
801 "uid_mid" => ["UNIQUE", "uid", "mid"],
805 "comment" => "notifications",
807 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
808 "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => ""],
809 "type" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
810 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
811 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
812 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
813 "date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
814 "msg" => ["type" => "mediumtext", "comment" => ""],
815 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
816 "link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
817 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id"],
818 "parent" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
819 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
820 "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""],
821 "otype" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => ""],
822 "name_cache" => ["type" => "tinytext", "comment" => "Cached bbcode parsing of name"],
823 "msg_cache" => ["type" => "mediumtext", "comment" => "Cached bbcode parsing of msg"]
827 "hash_uid" => ["hash", "uid"],
828 "seen_uid_date" => ["seen", "uid", "date"],
829 "uid_date" => ["uid", "date"],
830 "uid_type_link" => ["uid", "type", "link(190)"],
833 "notify-threads" => [
836 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
837 "notify-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["notify" => "id"], "comment" => ""],
838 "master-parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"],
840 "parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
841 "receiver-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"],
842 "comment" => "User id"],
849 "comment" => "cache for OEmbed queries",
851 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
852 "maxwidth" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "comment" => "Maximum width passed to Oembed"],
853 "content" => ["type" => "mediumtext", "comment" => "OEmbed data of the page"],
854 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
857 "PRIMARY" => ["url", "maxwidth"],
858 "created" => ["created"],
861 "openwebauth-token" => [
862 "comment" => "Store OpenWebAuth token to verify contacts",
864 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
865 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
866 "type" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Verify type"],
867 "token" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A generated token"],
868 "meta" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
869 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
876 "comment" => "cache for 'parse_url' queries",
878 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
879 "guessing" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the 'guessing' mode active?"],
880 "oembed" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the data the result of oembed?"],
881 "content" => ["type" => "mediumtext", "comment" => "page data"],
882 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
885 "PRIMARY" => ["url", "guessing", "oembed"],
886 "created" => ["created"],
890 "comment" => "Storage for participation messages from Diaspora",
892 "iid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["item" => "id"], "comment" => ""],
893 "server" => ["type" => "varchar(60)", "not null" => "1", "primary" => "1", "comment" => ""],
894 "cid" => ["type" => "int unsigned", "not null" => "1", "relation" => ["contact" => "id"], "comment" => ""],
895 "fid" => ["type" => "int unsigned", "not null" => "1", "relation" => ["fcontact" => "id"], "comment" => ""],
898 "PRIMARY" => ["iid", "server"],
904 "comment" => "personal (per user) configuration storage",
906 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
907 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
908 "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
909 "k" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => ""],
910 "v" => ["type" => "mediumtext", "comment" => ""],
914 "uid_cat_k" => ["UNIQUE", "uid", "cat", "k"],
920 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
921 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner id of this permission set"],
922 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
923 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
924 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
925 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
929 "uid_allow_cid_allow_gid_deny_cid_deny_gid" => ["allow_cid(50)", "allow_gid(30)", "deny_cid(50)", "deny_gid(30)"],
933 "comment" => "photo storage",
935 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
936 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
937 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
938 "guid" => ["type" => "char(16)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this photo"],
939 "resource-id" => ["type" => "char(32)", "not null" => "1", "default" => "", "comment" => ""],
940 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation date"],
941 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edited date"],
942 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
943 "desc" => ["type" => "text", "comment" => ""],
944 "album" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "The name of the album to which the photo belongs"],
945 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
946 "type" => ["type" => "varchar(30)", "not null" => "1", "default" => "image/jpeg"],
947 "height" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
948 "width" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
949 "datasize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
950 "data" => ["type" => "mediumblob", "not null" => "1", "comment" => ""],
951 "scale" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
952 "profile" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
953 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
954 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
955 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
956 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
960 "contactid" => ["contact-id"],
961 "uid_contactid" => ["uid", "contact-id"],
962 "uid_profile" => ["uid", "profile"],
963 "uid_album_scale_created" => ["uid", "album(32)", "scale", "created"],
964 "uid_album_resource-id_created" => ["uid", "album(32)", "resource-id", "created"],
965 "resource-id" => ["resource-id"],
969 "comment" => "Currently unused table for storing poll results",
971 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
972 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
973 "q0" => ["type" => "text", "comment" => ""],
974 "q1" => ["type" => "text", "comment" => ""],
975 "q2" => ["type" => "text", "comment" => ""],
976 "q3" => ["type" => "text", "comment" => ""],
977 "q4" => ["type" => "text", "comment" => ""],
978 "q5" => ["type" => "text", "comment" => ""],
979 "q6" => ["type" => "text", "comment" => ""],
980 "q7" => ["type" => "text", "comment" => ""],
981 "q8" => ["type" => "text", "comment" => ""],
982 "q9" => ["type" => "text", "comment" => ""],
990 "comment" => "data for polls - currently unused",
992 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
993 "poll_id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["poll" => "id"]],
994 "choice" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
998 "poll_id" => ["poll_id"],
1002 "comment" => "Currently running system processes",
1004 "pid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "comment" => ""],
1005 "command" => ["type" => "varbinary(32)", "not null" => "1", "default" => "", "comment" => ""],
1006 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1009 "PRIMARY" => ["pid"],
1010 "command" => ["command"],
1014 "comment" => "user profiles data",
1016 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1017 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
1018 "profile-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name of the profile"],
1019 "is-default" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Mark this profile as default profile"],
1020 "hide-friends" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide friend list from viewers of this profile"],
1021 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1022 "pdesc" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Title or description"],
1023 "dob" => ["type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00", "comment" => "Day of birth"],
1024 "address" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1025 "locality" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1026 "region" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1027 "postal-code" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1028 "country-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1029 "hometown" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1030 "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1031 "marital" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1032 "with" => ["type" => "text", "comment" => ""],
1033 "howlong" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1034 "sexual" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1035 "politic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1036 "religion" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1037 "pub_keywords" => ["type" => "text", "comment" => ""],
1038 "prv_keywords" => ["type" => "text", "comment" => ""],
1039 "likes" => ["type" => "text", "comment" => ""],
1040 "dislikes" => ["type" => "text", "comment" => ""],
1041 "about" => ["type" => "text", "comment" => ""],
1042 "summary" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1043 "music" => ["type" => "text", "comment" => ""],
1044 "book" => ["type" => "text", "comment" => ""],
1045 "tv" => ["type" => "text", "comment" => ""],
1046 "film" => ["type" => "text", "comment" => ""],
1047 "interest" => ["type" => "text", "comment" => ""],
1048 "romance" => ["type" => "text", "comment" => ""],
1049 "work" => ["type" => "text", "comment" => ""],
1050 "education" => ["type" => "text", "comment" => ""],
1051 "contact" => ["type" => "text", "comment" => ""],
1052 "homepage" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1053 "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1054 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1055 "thumb" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1056 "publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish default profile in local directory"],
1057 "net-publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish profile in global directory"],
1060 "PRIMARY" => ["id"],
1061 "uid_is-default" => ["uid", "is-default"],
1062 "pub_keywords" => ["FULLTEXT", "pub_keywords"],
1065 "profile_check" => [
1066 "comment" => "DFRN remote auth use",
1068 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1069 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1070 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
1071 "dfrn_id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1072 "sec" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1073 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1076 "PRIMARY" => ["id"],
1079 "push_subscriber" => [
1080 "comment" => "Used for OStatus: Contains feed subscribers",
1082 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1083 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1084 "callback_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1085 "topic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1086 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1087 "push" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1088 "last_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last successful trial"],
1089 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1090 "renewed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last subscription renewal"],
1091 "secret" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1094 "PRIMARY" => ["id"],
1095 "next_try" => ["next_try"],
1099 "comment" => "Queue for messages that couldn't be delivered",
1101 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1102 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Message receiver"],
1103 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Receiver's network"],
1104 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Unique GUID of the message"],
1105 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date, when the message was created"],
1106 "last" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last trial"],
1107 "next" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1108 "retrial" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1109 "content" => ["type" => "mediumtext", "comment" => ""],
1110 "batch" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1113 "PRIMARY" => ["id"],
1119 "comment" => "registrations requiring admin approval",
1121 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1122 "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1123 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1124 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1125 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1126 "language" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
1127 "note" => ["type" => "text", "comment" => ""],
1130 "PRIMARY" => ["id"],
1136 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1137 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1138 "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1141 "PRIMARY" => ["id"],
1146 "comment" => "web session storage",
1148 "id" => ["type" => "bigint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1149 "sid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
1150 "data" => ["type" => "text", "comment" => ""],
1151 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1154 "PRIMARY" => ["id"],
1155 "sid" => ["sid(64)"],
1156 "expire" => ["expire"],
1160 "comment" => "Diaspora signatures",
1162 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1163 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id"],
1164 "signed_text" => ["type" => "mediumtext", "comment" => ""],
1165 "signature" => ["type" => "text", "comment" => ""],
1166 "signer" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1169 "PRIMARY" => ["id"],
1170 "iid" => ["UNIQUE", "iid"],
1174 "comment" => "item taxonomy (categories, tags, etc.) table",
1176 "tid" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
1177 "oid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
1178 "otype" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1179 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1180 "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1181 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1182 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1183 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1184 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1185 "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1186 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1189 "PRIMARY" => ["tid"],
1190 "oid_otype_type_term" => ["oid", "otype", "type", "term(32)"],
1191 "uid_otype_type_term_global_created" => ["uid", "otype", "type", "term(32)", "global", "created"],
1192 "uid_otype_type_url" => ["uid", "otype", "type", "url(64)"],
1193 "guid" => ["guid(64)"],
1197 "comment" => "Thread related data",
1199 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"],
1200 "comment" => "sequential ID"],
1201 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1202 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
1203 "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item owner"],
1204 "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item author"],
1205 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1206 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1207 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1208 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1209 "changed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1210 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1211 "private" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1212 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1213 "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1214 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1215 "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1216 "ignored" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1217 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"],
1218 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
1219 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1220 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1221 "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1222 "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1223 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
1224 "bookmark" => ["type" => "boolean", "comment" => ""],
1227 "PRIMARY" => ["iid"],
1228 "uid_network_commented" => ["uid", "network", "commented"],
1229 "uid_network_created" => ["uid", "network", "created"],
1230 "uid_contactid_commented" => ["uid", "contact-id", "commented"],
1231 "uid_contactid_created" => ["uid", "contact-id", "created"],
1232 "contactid" => ["contact-id"],
1233 "ownerid" => ["owner-id"],
1234 "authorid" => ["author-id"],
1235 "uid_created" => ["uid", "created"],
1236 "uid_commented" => ["uid", "commented"],
1237 "uid_wall_created" => ["uid", "wall", "created"],
1238 "private_wall_origin_commented" => ["private", "wall", "origin", "commented"],
1242 "comment" => "OAuth usage",
1244 "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""],
1245 "secret" => ["type" => "text", "comment" => ""],
1246 "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "relation" => ["clients" => "client_id"]],
1247 "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
1248 "scope" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
1249 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1252 "PRIMARY" => ["id"],
1256 "comment" => "The local users",
1258 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1259 "parent-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"],
1260 "comment" => "The parent user that has full control about this user"],
1261 "guid" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this user"],
1262 "username" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this user is known by"],
1263 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "encrypted password"],
1264 "legacy_password" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the password hash double-hashed?"],
1265 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "nick- and user name"],
1266 "email" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "the users email address"],
1267 "openid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1268 "timezone" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => "PHP-legal timezone"],
1269 "language" => ["type" => "varchar(32)", "not null" => "1", "default" => "en", "comment" => "default language"],
1270 "register_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of registration"],
1271 "login_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last login"],
1272 "default-location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Default for item.location"],
1273 "allow_location" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 allows to display the location"],
1274 "theme" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "user theme preference"],
1275 "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
1276 "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
1277 "spubkey" => ["type" => "text", "comment" => ""],
1278 "sprvkey" => ["type" => "text", "comment" => ""],
1279 "verified" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "user is verified through email"],
1280 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 for user is blocked"],
1281 "blockwall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to post to the profile page of the user"],
1282 "hidewall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide profile details from unkown viewers"],
1283 "blocktags" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to tag the post of this user"],
1284 "unkmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Permit unknown people to send private mails to this user"],
1285 "cntunkmail" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
1286 "notify-flags" => ["type" => "smallint unsigned", "not null" => "1", "default" => "65535", "comment" => "email notification options"],
1287 "page-flags" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "page/profile type"],
1288 "account-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1289 "prvnets" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1290 "pwdreset" => ["type" => "varchar(255)", "comment" => "Password reset request token"],
1291 "pwdreset_time" => ["type" => "datetime", "comment" => "Timestamp of the last password reset request"],
1292 "maxreq" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
1293 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1294 "account_removed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if 1 the account is removed"],
1295 "account_expired" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1296 "account_expires_on" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp when account expires and will be deleted"],
1297 "expire_notification_sent" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last warning of account expiration"],
1298 "def_gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1299 "allow_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1300 "allow_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1301 "deny_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1302 "deny_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1303 "openidserver" => ["type" => "text", "comment" => ""],
1306 "PRIMARY" => ["uid"],
1307 "nickname" => ["nickname(32)"],
1311 "comment" => "Deleted usernames",
1313 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1314 "username" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
1317 "PRIMARY" => ["id"],
1318 "username" => ["username(32)"],
1322 "comment" => "User specific public contact data",
1324 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["contact" => "id"], "comment" => "Contact id of the linked public contact"],
1325 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
1326 "blocked" => ["type" => "boolean", "comment" => "Contact is completely blocked for this user"],
1327 "ignored" => ["type" => "boolean", "comment" => "Posts from this contact are ignored"],
1328 "collapsed" => ["type" => "boolean", "comment" => "Posts from this contact are collapsed"]
1331 "PRIMARY" => ["uid", "cid"]
1335 "comment" => "User specific item data",
1337 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"], "comment" => "Item id"],
1338 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
1339 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide an item from the user"],
1340 "ignored" => ["type" => "boolean", "comment" => "Ignore this thread if set"]
1343 "PRIMARY" => ["uid", "iid"]
1347 "comment" => "Inter process communication between the frontend and the worker",
1349 "key" => ["type" => "int", "not null" => "1", "primary" => "1", "comment" => ""],
1350 "jobs" => ["type" => "boolean", "comment" => "Flag for outstanding jobs"],
1353 "PRIMARY" => ["key"],
1355 "engine" => "MEMORY",
1358 "comment" => "Background tasks queue entries",
1360 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented worker task id"],
1361 "parameter" => ["type" => "mediumblob", "comment" => "Task command"],
1362 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Task priority"],
1363 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date"],
1364 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process id of the worker"],
1365 "executed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Execution date"],
1366 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1367 "retrial" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1368 "done" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marked 1 when the task was done - will be deleted later"],
1371 "PRIMARY" => ["id"],
1373 "parameter" => ["parameter(64)"],
1374 "priority_created_next_try" => ["priority", "created", "next_try"],
1375 "done_priority_executed_next_try" => ["done", "priority", "executed", "next_try"],
1376 "done_executed_next_try" => ["done", "executed", "next_try"],
1377 "done_priority_next_try" => ["done", "priority", "next_try"],
1378 "done_next_try" => ["done", "next_try"]