]> git.mxchange.org Git - friendica.git/blob - config/dbstructure.config.php
Fix mods/README.md format
[friendica.git] / config / dbstructure.config.php
1 <?php
2
3 /* Main database structure configuration file.
4  *
5  * Here are described all the tables, fields and indexes Friendica needs to work.
6  *
7  * Syntax (braces indicate optionale values):
8  * "<table name>" => [
9  *      "comment" => "Description of the table",
10  *      "fields" => [
11  *              "<field name>" => [
12  *                      "type" => "<field type>{(<field size>)} <unsigned>",
13  *                      "not null" => 0|1,
14  *                      {"extra" => "auto_increment",}
15  *                      {"default" => "<default value>",}
16  *                      {"default" => NULL_DATE,} (for datetime fields)
17  *                      {"primary" => "1",}
18  *                      {"relation" => ["<foreign key table name>" => "<foreign key field name>"],}
19  *                      "comment" => "Description of the fields"
20  *              ],
21  *              ...
22  *      ],
23  *      "indexes" => [
24  *              "PRIMARY" => ["<primary key field name>", ...],
25  *              "<index name>" => [{"UNIQUE",} "<field name>{(<key size>)}", ...]
26  *              ...
27  *      ],
28  * ],
29  *
30  * If you need to make any change, make sure to increment the DB_UPDATE_VERSION constant value below.
31  *
32  */
33
34 use Friendica\Database\DBA;
35
36 if (!defined('DB_UPDATE_VERSION')) {
37         define('DB_UPDATE_VERSION', 1291);
38 }
39
40 return [
41         "addon" => [
42                 "comment" => "registered addons",
43                 "fields" => [
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"],
51                 ],
52                 "indexes" => [
53                         "PRIMARY" => ["id"],
54                         "name" => ["UNIQUE", "name"],
55                 ]
56         ],
57         "apcontact" => [
58                 "comment" => "ActivityPub compatible contacts - used in the ActivityPub implementation",
59                 "fields" => [
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" => ""]
77                 ],
78                 "indexes" => [
79                         "PRIMARY" => ["url"],
80                         "addr" => ["addr(32)"],
81                         "alias" => ["alias(190)"],
82                         "url" => ["followers(190)"]
83                 ]
84         ],
85         "attach" => [
86                 "comment" => "file attachments",
87                 "fields" => [
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"],
101                 ],
102                 "indexes" => [
103                         "PRIMARY" => ["id"],
104                 ]
105         ],
106         "auth_codes" => [
107                 "comment" => "OAuth usage",
108                 "fields" => [
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"],
111                                 "comment" => ""],
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" => ""],
115                 ],
116                 "indexes" => [
117                         "PRIMARY" => ["id"],
118                 ]
119         ],
120         "cache" => [
121                 "comment" => "Stores temporary data",
122                 "fields" => [
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"],
127                 ],
128                 "indexes" => [
129                         "PRIMARY" => ["k"],
130                         "k_expires" => ["k", "expires"],
131                 ]
132         ],
133         "challenge" => [
134                 "comment" => "",
135                 "fields" => [
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" => ""],
142                 ],
143                 "indexes" => [
144                         "PRIMARY" => ["id"],
145                 ]
146         ],
147         "clients" => [
148                 "comment" => "OAuth usage",
149                 "fields" => [
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"],
156                 ],
157                 "indexes" => [
158                         "PRIMARY" => ["client_id"],
159                 ]
160         ],
161         "config" => [
162                 "comment" => "main configuration storage",
163                 "fields" => [
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" => ""],
168                 ],
169                 "indexes" => [
170                         "PRIMARY" => ["id"],
171                         "cat_k" => ["UNIQUE", "cat", "k"],
172                 ]
173         ],
174         "contact" => [
175                 "comment" => "contact table",
176                 "fields" => [
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" => ""],
246                 ],
247                 "indexes" => [
248                         "PRIMARY" => ["id"],
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)"],
261                 ]
262         ],
263         "conv" => [
264                 "comment" => "private messages",
265                 "fields" => [
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"],
274                 ],
275                 "indexes" => [
276                         "PRIMARY" => ["id"],
277                         "uid" => ["uid"],
278                 ]
279         ],
280         "conversation" => [
281                 "comment" => "Raw data and structure information for messages",
282                 "fields" => [
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"],
290                 ],
291                 "indexes" => [
292                         "PRIMARY" => ["item-uri"],
293                         "conversation-uri" => ["conversation-uri"],
294                         "received" => ["received"],
295                 ]
296         ],
297         "diaspora-interaction" => [
298                 "comment" => "Signed Diaspora Interaction",
299                 "fields" => [
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"]
302                 ],
303                 "indexes" => [
304                         "PRIMARY" => ["uri-id"]
305                 ]
306         ],
307         "event" => [
308                 "comment" => "Events",
309                 "fields" => [
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"],
330                 ],
331                 "indexes" => [
332                         "PRIMARY" => ["id"],
333                         "uid_start" => ["uid", "start"],
334                 ]
335         ],
336         "fcontact" => [
337                 "comment" => "Diaspora compatible contacts - used in the Diaspora implementation",
338                 "fields" => [
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" => ""],
356                 ],
357                 "indexes" => [
358                         "PRIMARY" => ["id"],
359                         "addr" => ["addr(32)"],
360                         "url" => ["UNIQUE", "url(190)"],
361                 ]
362         ],
363         "fsuggest" => [
364                 "comment" => "friend suggestion stuff",
365                 "fields" => [
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" => ""],
375                 ],
376                 "indexes" => [
377                         "PRIMARY" => ["id"],
378                 ]
379         ],
380         "gcign" => [
381                 "comment" => "contacts ignored by friend suggestions",
382                 "fields" => [
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"],
386                 ],
387                 "indexes" => [
388                         "PRIMARY" => ["id"],
389                         "uid" => ["uid"],
390                         "gcid" => ["gcid"],
391                 ]
392         ],
393         "gcontact" => [
394                 "comment" => "global contacts",
395                 "fields" => [
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"],
422                 ],
423                 "indexes" => [
424                         "PRIMARY" => ["id"],
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"],
431                 ]
432         ],
433         "glink" => [
434                 "comment" => "'friends of friends' linkages derived from poco",
435                 "fields" => [
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" => ""],
442                 ],
443                 "indexes" => [
444                         "PRIMARY" => ["id"],
445                         "cid_uid_gcid_zcid" => ["UNIQUE", "cid", "uid", "gcid", "zcid"],
446                         "gcid" => ["gcid"],
447                 ]
448         ],
449         "group" => [
450                 "comment" => "privacy groups, group info",
451                 "fields" => [
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"],
457                 ],
458                 "indexes" => [
459                         "PRIMARY" => ["id"],
460                         "uid" => ["uid"],
461                 ]
462         ],
463         "group_member" => [
464                 "comment" => "privacy groups, member info",
465                 "fields" => [
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"],
469                 ],
470                 "indexes" => [
471                         "PRIMARY" => ["id"],
472                         "contactid" => ["contact-id"],
473                         "gid_contactid" => ["UNIQUE", "gid", "contact-id"],
474                 ]
475         ],
476         "gserver" => [
477                 "comment" => "Global servers",
478                 "fields" => [
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" => ""],
497                 ],
498                 "indexes" => [
499                         "PRIMARY" => ["id"],
500                         "nurl" => ["UNIQUE", "nurl(190)"],
501                 ]
502         ],
503         "gserver-tag" => [
504                 "comment" => "Tags that the server has subscribed",
505                 "fields" => [
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"],
509                 ],
510                 "indexes" => [
511                         "PRIMARY" => ["gserver-id", "tag"],
512                         "tag" => ["tag"],
513                 ]
514         ],
515         "hook" => [
516                 "comment" => "addon hook registry",
517                 "fields" => [
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"],
523                 ],
524                 "indexes" => [
525                         "PRIMARY" => ["id"],
526                         "hook_file_function" => ["UNIQUE", "hook", "file", "function"],
527                 ]
528         ],
529         "intro" => [
530                 "comment" => "",
531                 "fields" => [
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" => ""],
543                 ],
544                 "indexes" => [
545                         "PRIMARY" => ["id"],
546                 ]
547         ],
548         "item" => [
549                 "comment" => "Structure for all posts",
550                 "fields" => [
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"],
626                 ],
627                 "indexes" => [
628                         "PRIMARY" => ["id"],
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"],
652                         "icid" => ["icid"],
653                         "iaid" => ["iaid"],
654                         "psid_wall" => ["psid", "wall"],
655                 ]
656         ],
657         "item-activity" => [
658                 "comment" => "Activities for items",
659                 "fields" => [
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" => ""]
665                 ],
666                 "indexes" => [
667                         "PRIMARY" => ["id"],
668                         "uri-hash" => ["UNIQUE", "uri-hash"],
669                         "uri" => ["uri(191)"],
670                         "uri-id" => ["uri-id"]
671                 ]
672         ],
673         "item-content" => [
674                 "comment" => "Content for all posts",
675                 "fields" => [
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"]
695                 ],
696                 "indexes" => [
697                         "PRIMARY" => ["id"],
698                         "uri-plink-hash" => ["UNIQUE", "uri-plink-hash"],
699                         "uri" => ["uri(191)"],
700                         "uri-id" => ["uri-id"]
701                 ]
702         ],
703         "item-delivery-data" => [
704                 "comment" => "Delivery data for items",
705                 "fields" => [
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"],
709                 ],
710                 "indexes" => [
711                         "PRIMARY" => ["iid"],
712                 ]
713         ],
714         "item-uri" => [
715                 "comment" => "URI and GUID for items",
716                 "fields" => [
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"]
720                 ],
721                 "indexes" => [
722                         "PRIMARY" => ["id"],
723                         "uri" => ["UNIQUE", "uri"],
724                         "guid" => ["guid"]
725                 ]
726         ],
727         "locks" => [
728                 "comment" => "",
729                 "fields" => [
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"],
735                 ],
736                 "indexes" => [
737                         "PRIMARY" => ["id"],
738                         "name_expires" => ["name", "expires"]
739                 ]
740         ],
741         "mail" => [
742                 "comment" => "private messages",
743                 "fields" => [
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"],
761                 ],
762                 "indexes" => [
763                         "PRIMARY" => ["id"],
764                         "uid_seen" => ["uid", "seen"],
765                         "convid" => ["convid"],
766                         "uri" => ["uri(64)"],
767                         "parent-uri" => ["parent-uri(64)"],
768                         "contactid" => ["contact-id(32)"],
769                 ]
770         ],
771         "mailacct" => [
772                 "comment" => "Mail account data for fetching mails",
773                 "fields" => [
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" => ""],
787                 ],
788                 "indexes" => [
789                         "PRIMARY" => ["id"],
790                 ]
791         ],
792         "manage" => [
793                 "comment" => "table of accounts that can manage each other",
794                 "fields" => [
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"],
798                 ],
799                 "indexes" => [
800                         "PRIMARY" => ["id"],
801                         "uid_mid" => ["UNIQUE", "uid", "mid"],
802                 ]
803         ],
804         "notify" => [
805                 "comment" => "notifications",
806                 "fields" => [
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"]
824                 ],
825                 "indexes" => [
826                         "PRIMARY" => ["id"],
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)"],
831                 ]
832         ],
833         "notify-threads" => [
834                 "comment" => "",
835                 "fields" => [
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"],
839                                 "comment" => ""],
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"],
843                 ],
844                 "indexes" => [
845                         "PRIMARY" => ["id"],
846                 ]
847         ],
848         "oembed" => [
849                 "comment" => "cache for OEmbed queries",
850                 "fields" => [
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"],
855                 ],
856                 "indexes" => [
857                         "PRIMARY" => ["url", "maxwidth"],
858                         "created" => ["created"],
859                 ]
860         ],
861         "openwebauth-token" => [
862                 "comment" => "Store OpenWebAuth token to verify contacts",
863                 "fields" => [
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"],
870                 ],
871                 "indexes" => [
872                         "PRIMARY" => ["id"],
873                 ]
874         ],
875         "parsed_url" => [
876                 "comment" => "cache for 'parse_url' queries",
877                 "fields" => [
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"],
883                 ],
884                 "indexes" => [
885                         "PRIMARY" => ["url", "guessing", "oembed"],
886                         "created" => ["created"],
887                 ]
888         ],
889         "participation" => [
890                 "comment" => "Storage for participation messages from Diaspora",
891                 "fields" => [
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" => ""],
896                 ],
897                 "indexes" => [
898                         "PRIMARY" => ["iid", "server"],
899                         "cid" => ["cid"],
900                         "fid" => ["fid"]
901                 ]
902         ],
903         "pconfig" => [
904                 "comment" => "personal (per user) configuration storage",
905                 "fields" => [
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" => ""],
911                 ],
912                 "indexes" => [
913                         "PRIMARY" => ["id"],
914                         "uid_cat_k" => ["UNIQUE", "uid", "cat", "k"],
915                 ]
916         ],
917         "permissionset" => [
918                 "comment" => "",
919                 "fields" => [
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"],
926                 ],
927                 "indexes" => [
928                         "PRIMARY" => ["id"],
929                         "uid_allow_cid_allow_gid_deny_cid_deny_gid" => ["allow_cid(50)", "allow_gid(30)", "deny_cid(50)", "deny_gid(30)"],
930                 ]
931         ],
932         "photo" => [
933                 "comment" => "photo storage",
934                 "fields" => [
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"],
957                 ],
958                 "indexes" => [
959                         "PRIMARY" => ["id"],
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"],
966                 ]
967         ],
968         "poll" => [
969                 "comment" => "Currently unused table for storing poll results",
970                 "fields" => [
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" => ""],
983                 ],
984                 "indexes" => [
985                         "PRIMARY" => ["id"],
986                         "uid" => ["uid"],
987                 ]
988         ],
989         "poll_result" => [
990                 "comment" => "data for polls - currently unused",
991                 "fields" => [
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" => ""],
995                 ],
996                 "indexes" => [
997                         "PRIMARY" => ["id"],
998                         "poll_id" => ["poll_id"],
999                 ]
1000         ],
1001         "process" => [
1002                 "comment" => "Currently running system processes",
1003                 "fields" => [
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" => ""],
1007                 ],
1008                 "indexes" => [
1009                         "PRIMARY" => ["pid"],
1010                         "command" => ["command"],
1011                 ]
1012         ],
1013         "profile" => [
1014                 "comment" => "user profiles data",
1015                 "fields" => [
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"],
1058                 ],
1059                 "indexes" => [
1060                         "PRIMARY" => ["id"],
1061                         "uid_is-default" => ["uid", "is-default"],
1062                 ]
1063         ],
1064         "profile_check" => [
1065                 "comment" => "DFRN remote auth use",
1066                 "fields" => [
1067                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1068                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1069                         "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
1070                         "dfrn_id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1071                         "sec" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1072                         "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1073                 ],
1074                 "indexes" => [
1075                         "PRIMARY" => ["id"],
1076                 ]
1077         ],
1078         "push_subscriber" => [
1079                 "comment" => "Used for OStatus: Contains feed subscribers",
1080                 "fields" => [
1081                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1082                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1083                         "callback_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1084                         "topic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1085                         "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1086                         "push" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1087                         "last_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last successful trial"],
1088                         "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1089                         "renewed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last subscription renewal"],
1090                         "secret" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1091                 ],
1092                 "indexes" => [
1093                         "PRIMARY" => ["id"],
1094                         "next_try" => ["next_try"],
1095                 ]
1096         ],
1097         "queue" => [
1098                 "comment" => "Queue for messages that couldn't be delivered",
1099                 "fields" => [
1100                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1101                         "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Message receiver"],
1102                         "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Receiver's network"],
1103                         "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Unique GUID of the message"],
1104                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date, when the message was created"],
1105                         "last" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last trial"],
1106                         "next" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1107                         "retrial" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1108                         "content" => ["type" => "mediumtext", "comment" => ""],
1109                         "batch" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1110                 ],
1111                 "indexes" => [
1112                         "PRIMARY" => ["id"],
1113                         "last" => ["last"],
1114                         "next" => ["next"],
1115                 ]
1116         ],
1117         "register" => [
1118                 "comment" => "registrations requiring admin approval",
1119                 "fields" => [
1120                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1121                         "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1122                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1123                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1124                         "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1125                         "language" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
1126                         "note" => ["type" => "text", "comment" => ""],
1127                 ],
1128                 "indexes" => [
1129                         "PRIMARY" => ["id"],
1130                 ]
1131         ],
1132         "search" => [
1133                 "comment" => "",
1134                 "fields" => [
1135                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1136                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1137                         "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1138                 ],
1139                 "indexes" => [
1140                         "PRIMARY" => ["id"],
1141                         "uid" => ["uid"],
1142                 ]
1143         ],
1144         "session" => [
1145                 "comment" => "web session storage",
1146                 "fields" => [
1147                         "id" => ["type" => "bigint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1148                         "sid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
1149                         "data" => ["type" => "text", "comment" => ""],
1150                         "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1151                 ],
1152                 "indexes" => [
1153                         "PRIMARY" => ["id"],
1154                         "sid" => ["sid(64)"],
1155                         "expire" => ["expire"],
1156                 ]
1157         ],
1158         "sign" => [
1159                 "comment" => "Diaspora signatures",
1160                 "fields" => [
1161                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1162                         "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id"],
1163                         "signed_text" => ["type" => "mediumtext", "comment" => ""],
1164                         "signature" => ["type" => "text", "comment" => ""],
1165                         "signer" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1166                 ],
1167                 "indexes" => [
1168                         "PRIMARY" => ["id"],
1169                         "iid" => ["UNIQUE", "iid"],
1170                 ]
1171         ],
1172         "term" => [
1173                 "comment" => "item taxonomy (categories, tags, etc.) table",
1174                 "fields" => [
1175                         "tid" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
1176                         "oid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
1177                         "otype" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1178                         "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1179                         "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1180                         "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1181                         "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1182                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1183                         "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1184                         "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1185                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1186                 ],
1187                 "indexes" => [
1188                         "PRIMARY" => ["tid"],
1189                         "oid_otype_type_term" => ["oid", "otype", "type", "term(32)"],
1190                         "uid_otype_type_term_global_created" => ["uid", "otype", "type", "term(32)", "global", "created"],
1191                         "uid_otype_type_url" => ["uid", "otype", "type", "url(64)"],
1192                         "guid" => ["guid(64)"],
1193                 ]
1194         ],
1195         "thread" => [
1196                 "comment" => "Thread related data",
1197                 "fields" => [
1198                         "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"],
1199                                 "comment" => "sequential ID"],
1200                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1201                         "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
1202                         "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item owner"],
1203                         "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item author"],
1204                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1205                         "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1206                         "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1207                         "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1208                         "changed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1209                         "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1210                         "private" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1211                         "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1212                         "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1213                         "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1214                         "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1215                         "ignored" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1216                         "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"],
1217                         "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
1218                         "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1219                         "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1220                         "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1221                         "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1222                         "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
1223                         "bookmark" => ["type" => "boolean", "comment" => ""],
1224                 ],
1225                 "indexes" => [
1226                         "PRIMARY" => ["iid"],
1227                         "uid_network_commented" => ["uid", "network", "commented"],
1228                         "uid_network_created" => ["uid", "network", "created"],
1229                         "uid_contactid_commented" => ["uid", "contact-id", "commented"],
1230                         "uid_contactid_created" => ["uid", "contact-id", "created"],
1231                         "contactid" => ["contact-id"],
1232                         "ownerid" => ["owner-id"],
1233                         "authorid" => ["author-id"],
1234                         "uid_created" => ["uid", "created"],
1235                         "uid_commented" => ["uid", "commented"],
1236                         "uid_wall_created" => ["uid", "wall", "created"],
1237                         "private_wall_origin_commented" => ["private", "wall", "origin", "commented"],
1238                 ]
1239         ],
1240         "tokens" => [
1241                 "comment" => "OAuth usage",
1242                 "fields" => [
1243                         "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""],
1244                         "secret" => ["type" => "text", "comment" => ""],
1245                         "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "relation" => ["clients" => "client_id"]],
1246                         "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
1247                         "scope" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
1248                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1249                 ],
1250                 "indexes" => [
1251                         "PRIMARY" => ["id"],
1252                 ]
1253         ],
1254         "user" => [
1255                 "comment" => "The local users",
1256                 "fields" => [
1257                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1258                         "parent-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"],
1259                                 "comment" => "The parent user that has full control about this user"],
1260                         "guid" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this user"],
1261                         "username" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this user is known by"],
1262                         "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "encrypted password"],
1263                         "legacy_password" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the password hash double-hashed?"],
1264                         "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "nick- and user name"],
1265                         "email" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "the users email address"],
1266                         "openid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1267                         "timezone" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => "PHP-legal timezone"],
1268                         "language" => ["type" => "varchar(32)", "not null" => "1", "default" => "en", "comment" => "default language"],
1269                         "register_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of registration"],
1270                         "login_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last login"],
1271                         "default-location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Default for item.location"],
1272                         "allow_location" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 allows to display the location"],
1273                         "theme" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "user theme preference"],
1274                         "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
1275                         "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
1276                         "spubkey" => ["type" => "text", "comment" => ""],
1277                         "sprvkey" => ["type" => "text", "comment" => ""],
1278                         "verified" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "user is verified through email"],
1279                         "blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 for user is blocked"],
1280                         "blockwall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to post to the profile page of the user"],
1281                         "hidewall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide profile details from unkown viewers"],
1282                         "blocktags" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to tag the post of this user"],
1283                         "unkmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Permit unknown people to send private mails to this user"],
1284                         "cntunkmail" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
1285                         "notify-flags" => ["type" => "smallint unsigned", "not null" => "1", "default" => "65535", "comment" => "email notification options"],
1286                         "page-flags" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "page/profile type"],
1287                         "account-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1288                         "prvnets" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1289                         "pwdreset" => ["type" => "varchar(255)", "comment" => "Password reset request token"],
1290                         "pwdreset_time" => ["type" => "datetime", "comment" => "Timestamp of the last password reset request"],
1291                         "maxreq" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
1292                         "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1293                         "account_removed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if 1 the account is removed"],
1294                         "account_expired" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1295                         "account_expires_on" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp when account expires and will be deleted"],
1296                         "expire_notification_sent" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last warning of account expiration"],
1297                         "def_gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1298                         "allow_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1299                         "allow_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1300                         "deny_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1301                         "deny_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1302                         "openidserver" => ["type" => "text", "comment" => ""],
1303                 ],
1304                 "indexes" => [
1305                         "PRIMARY" => ["uid"],
1306                         "nickname" => ["nickname(32)"],
1307                 ]
1308         ],
1309         "userd" => [
1310                 "comment" => "Deleted usernames",
1311                 "fields" => [
1312                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1313                         "username" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
1314                 ],
1315                 "indexes" => [
1316                         "PRIMARY" => ["id"],
1317                         "username" => ["username(32)"],
1318                 ]
1319         ],
1320         "user-contact" => [
1321                 "comment" => "User specific public contact data",
1322                 "fields" => [
1323                         "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["contact" => "id"], "comment" => "Contact id of the linked public contact"],
1324                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
1325                         "blocked" => ["type" => "boolean", "comment" => "Contact is completely blocked for this user"],
1326                         "ignored" => ["type" => "boolean", "comment" => "Posts from this contact are ignored"],
1327                         "collapsed" => ["type" => "boolean", "comment" => "Posts from this contact are collapsed"]
1328                 ],
1329                 "indexes" => [
1330                         "PRIMARY" => ["uid", "cid"]
1331                 ]
1332         ],
1333         "user-item" => [
1334                 "comment" => "User specific item data",
1335                 "fields" => [
1336                         "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"], "comment" => "Item id"],
1337                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
1338                         "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide an item from the user"],
1339                         "ignored" => ["type" => "boolean", "comment" => "Ignore this thread if set"]
1340                 ],
1341                 "indexes" => [
1342                         "PRIMARY" => ["uid", "iid"]
1343                 ]
1344         ],
1345         "worker-ipc" => [
1346                 "comment" => "Inter process communication between the frontend and the worker",
1347                 "fields" => [
1348                         "key" => ["type" => "int", "not null" => "1", "primary" => "1", "comment" => ""],
1349                         "jobs" => ["type" => "boolean", "comment" => "Flag for outstanding jobs"],
1350                 ],
1351                 "indexes" => [
1352                         "PRIMARY" => ["key"],
1353                 ],
1354                 "engine" => "MEMORY",
1355         ],
1356         "workerqueue" => [
1357                 "comment" => "Background tasks queue entries",
1358                 "fields" => [
1359                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented worker task id"],
1360                         "parameter" => ["type" => "mediumblob", "comment" => "Task command"],
1361                         "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Task priority"],
1362                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date"],
1363                         "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process id of the worker"],
1364                         "executed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Execution date"],
1365                         "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1366                         "retrial" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1367                         "done" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marked 1 when the task was done - will be deleted later"],
1368                 ],
1369                 "indexes" => [
1370                         "PRIMARY" => ["id"],
1371                         "pid" => ["pid"],
1372                         "parameter" => ["parameter(64)"],
1373                         "priority_created_next_try" => ["priority", "created", "next_try"],
1374                         "done_priority_executed_next_try" => ["done", "priority", "executed", "next_try"],
1375                         "done_executed_next_try" => ["done", "executed", "next_try"],
1376                         "done_priority_next_try" => ["done", "priority", "next_try"],
1377                         "done_next_try" => ["done", "next_try"]
1378                 ]
1379         ]
1380 ];