]> git.mxchange.org Git - friendica.git/blob - config/dbstructure.config.php
0be6ba4028460de32a3adf57a3826ccd9e3215dc
[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', 1298);
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                         "manually-approve" => ["type" => "boolean", "comment" => ""],
69                         "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
70                         "name" => ["type" => "varchar(255)", "comment" => ""],
71                         "about" => ["type" => "text", "comment" => ""],
72                         "photo" => ["type" => "varchar(255)", "comment" => ""],
73                         "addr" => ["type" => "varchar(255)", "comment" => ""],
74                         "alias" => ["type" => "varchar(255)", "comment" => ""],
75                         "pubkey" => ["type" => "text", "comment" => ""],
76                         "baseurl" => ["type" => "varchar(255)", "comment" => "baseurl of the ap contact"],
77                         "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
78                 ],
79                 "indexes" => [
80                         "PRIMARY" => ["url"],
81                         "addr" => ["addr(32)"],
82                         "alias" => ["alias(190)"],
83                         "url" => ["followers(190)"]
84                 ]
85         ],
86         "attach" => [
87                 "comment" => "file attachments",
88                 "fields" => [
89                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "generated index"],
90                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
91                         "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "hash"],
92                         "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "filename of original"],
93                         "filetype" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "mimetype"],
94                         "filesize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "size in bytes"],
95                         "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"],
96                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
97                         "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
98                         "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>"],
99                         "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
100                         "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
101                         "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
102                 ],
103                 "indexes" => [
104                         "PRIMARY" => ["id"],
105                 ]
106         ],
107         "auth_codes" => [
108                 "comment" => "OAuth usage",
109                 "fields" => [
110                         "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""],
111                         "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "relation" => ["clients" => "client_id"],
112                                 "comment" => ""],
113                         "redirect_uri" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
114                         "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
115                         "scope" => ["type" => "varchar(250)", "not null" => "1", "default" => "", "comment" => ""],
116                 ],
117                 "indexes" => [
118                         "PRIMARY" => ["id"],
119                 ]
120         ],
121         "cache" => [
122                 "comment" => "Stores temporary data",
123                 "fields" => [
124                         "k" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "cache key"],
125                         "v" => ["type" => "mediumtext", "comment" => "cached serialized value"],
126                         "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
127                         "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache insertion"],
128                 ],
129                 "indexes" => [
130                         "PRIMARY" => ["k"],
131                         "k_expires" => ["k", "expires"],
132                 ]
133         ],
134         "challenge" => [
135                 "comment" => "",
136                 "fields" => [
137                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
138                         "challenge" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
139                         "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
140                         "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
141                         "type" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
142                         "last_update" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
143                 ],
144                 "indexes" => [
145                         "PRIMARY" => ["id"],
146                 ]
147         ],
148         "clients" => [
149                 "comment" => "OAuth usage",
150                 "fields" => [
151                         "client_id" => ["type" => "varchar(20)", "not null" => "1", "primary" => "1", "comment" => ""],
152                         "pw" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => ""],
153                         "redirect_uri" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
154                         "name" => ["type" => "text", "comment" => ""],
155                         "icon" => ["type" => "text", "comment" => ""],
156                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
157                 ],
158                 "indexes" => [
159                         "PRIMARY" => ["client_id"],
160                 ]
161         ],
162         "config" => [
163                 "comment" => "main configuration storage",
164                 "fields" => [
165                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
166                         "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
167                         "k" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
168                         "v" => ["type" => "mediumtext", "comment" => ""],
169                 ],
170                 "indexes" => [
171                         "PRIMARY" => ["id"],
172                         "cat_k" => ["UNIQUE", "cat", "k"],
173                 ]
174         ],
175         "contact" => [
176                 "comment" => "contact table",
177                 "fields" => [
178                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
179                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
180                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
181                         "self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if the contact is the user him/her self"],
182                         "remote_self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
183                         "rel" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "The kind of the relation between the user and the contact"],
184                         "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
185                         "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network protocol of the contact"],
186                         "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"],
187                         "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"],
188                         "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
189                         "about" => ["type" => "text", "comment" => ""],
190                         "keywords" => ["type" => "text", "comment" => "public keywords (interests) of the contact"],
191                         "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
192                         "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
193                         "attag" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
194                         "avatar" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
195                         "photo" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo of the contact"],
196                         "thumb" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (thumb size)"],
197                         "micro" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (micro size)"],
198                         "site-pubkey" => ["type" => "text", "comment" => ""],
199                         "issued-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
200                         "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
201                         "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
202                         "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
203                         "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
204                         "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
205                         "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
206                         "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
207                         "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
208                         "request" => ["type" => "varchar(255)", "comment" => ""],
209                         "notify" => ["type" => "varchar(255)", "comment" => ""],
210                         "poll" => ["type" => "varchar(255)", "comment" => ""],
211                         "confirm" => ["type" => "varchar(255)", "comment" => ""],
212                         "poco" => ["type" => "varchar(255)", "comment" => ""],
213                         "aes_allow" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
214                         "ret-aes" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
215                         "usehub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
216                         "subhub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
217                         "hub-verify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
218                         "last-update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last try to update the contact info"],
219                         "success_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful contact update"],
220                         "failure_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed update"],
221                         "name-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
222                         "uri-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
223                         "avatar-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
224                         "term-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
225                         "last-item" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "date of the last post"],
226                         "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
227                         "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
228                         "readonly" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "posts of the contact are readonly"],
229                         "writable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
230                         "forum" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a forum"],
231                         "prv" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a private group"],
232                         "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
233                         "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
234                         "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
235                         "pending" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
236                         "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact has been deleted"],
237                         "rating" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
238                         "reason" => ["type" => "text", "comment" => ""],
239                         "closeness" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "99", "comment" => ""],
240                         "info" => ["type" => "mediumtext", "comment" => ""],
241                         "profile-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
242                         "bdyear" => ["type" => "varchar(4)", "not null" => "1", "default" => "", "comment" => ""],
243                         "bd" => ["type" => "date", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""],
244                         "notify_new_posts" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
245                         "fetch_further_information" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
246                         "ffi_keyword_blacklist" => ["type" => "text", "comment" => ""],
247                 ],
248                 "indexes" => [
249                         "PRIMARY" => ["id"],
250                         "uid_name" => ["uid", "name(190)"],
251                         "self_uid" => ["self", "uid"],
252                         "alias_uid" => ["alias(32)", "uid"],
253                         "pending_uid" => ["pending", "uid"],
254                         "blocked_uid" => ["blocked", "uid"],
255                         "uid_rel_network_poll" => ["uid", "rel", "network", "poll(64)", "archive"],
256                         "uid_network_batch" => ["uid", "network", "batch(64)"],
257                         "addr_uid" => ["addr(32)", "uid"],
258                         "nurl_uid" => ["nurl(32)", "uid"],
259                         "nick_uid" => ["nick(32)", "uid"],
260                         "dfrn-id" => ["dfrn-id(64)"],
261                         "issued-id" => ["issued-id(64)"],
262                 ]
263         ],
264         "conv" => [
265                 "comment" => "private messages",
266                 "fields" => [
267                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
268                         "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this conversation"],
269                         "recips" => ["type" => "text", "comment" => "sender_handle;recipient_handle"],
270                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
271                         "creator" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "handle of creator"],
272                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation timestamp"],
273                         "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "edited timestamp"],
274                         "subject" => ["type" => "text", "comment" => "subject of initial message"],
275                 ],
276                 "indexes" => [
277                         "PRIMARY" => ["id"],
278                         "uid" => ["uid"],
279                 ]
280         ],
281         "conversation" => [
282                 "comment" => "Raw data and structure information for messages",
283                 "fields" => [
284                         "item-uri" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "Original URI of the item - unrelated to the table with the same name"],
285                         "reply-to-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "URI to which this item is a reply"],
286                         "conversation-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation URI"],
287                         "conversation-href" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation link"],
288                         "protocol" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "255", "comment" => "The protocol of the item"],
289                         "source" => ["type" => "mediumtext", "comment" => "Original source"],
290                         "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Receiving date"],
291                 ],
292                 "indexes" => [
293                         "PRIMARY" => ["item-uri"],
294                         "conversation-uri" => ["conversation-uri"],
295                         "received" => ["received"],
296                 ]
297         ],
298         "diaspora-interaction" => [
299                 "comment" => "Signed Diaspora Interaction",
300                 "fields" => [
301                         "uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
302                         "interaction" => ["type" => "mediumtext", "comment" => "The Diaspora interaction"]
303                 ],
304                 "indexes" => [
305                         "PRIMARY" => ["uri-id"]
306                 ]
307         ],
308         "event" => [
309                 "comment" => "Events",
310                 "fields" => [
311                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
312                         "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
313                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
314                         "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact_id (ID of the contact in contact table)"],
315                         "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
316                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
317                         "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
318                         "start" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event start time"],
319                         "finish" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event end time"],
320                         "summary" => ["type" => "text", "comment" => "short description or title of the event"],
321                         "desc" => ["type" => "text", "comment" => "event description"],
322                         "location" => ["type" => "text", "comment" => "event location"],
323                         "type" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => "event or birthday"],
324                         "nofinish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if event does have no end this is 1"],
325                         "adjust" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "adjust to timezone of the recipient (0 or 1)"],
326                         "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "0 or 1"],
327                         "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
328                         "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
329                         "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
330                         "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
331                 ],
332                 "indexes" => [
333                         "PRIMARY" => ["id"],
334                         "uid_start" => ["uid", "start"],
335                 ]
336         ],
337         "fcontact" => [
338                 "comment" => "Diaspora compatible contacts - used in the Diaspora implementation",
339                 "fields" => [
340                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
341                         "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "unique id"],
342                         "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
343                         "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
344                         "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
345                         "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
346                         "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
347                         "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
348                         "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
349                         "notify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
350                         "poll" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
351                         "confirm" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
352                         "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
353                         "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
354                         "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
355                         "pubkey" => ["type" => "text", "comment" => ""],
356                         "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
357                 ],
358                 "indexes" => [
359                         "PRIMARY" => ["id"],
360                         "addr" => ["addr(32)"],
361                         "url" => ["UNIQUE", "url(190)"],
362                 ]
363         ],
364         "fsuggest" => [
365                 "comment" => "friend suggestion stuff",
366                 "fields" => [
367                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
368                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
369                         "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
370                         "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
371                         "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
372                         "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
373                         "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
374                         "note" => ["type" => "text", "comment" => ""],
375                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
376                 ],
377                 "indexes" => [
378                         "PRIMARY" => ["id"],
379                 ]
380         ],
381         "gcign" => [
382                 "comment" => "contacts ignored by friend suggestions",
383                 "fields" => [
384                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
385                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Local User id"],
386                         "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => "gcontact.id of ignored contact"],
387                 ],
388                 "indexes" => [
389                         "PRIMARY" => ["id"],
390                         "uid" => ["uid"],
391                         "gcid" => ["gcid"],
392                 ]
393         ],
394         "gcontact" => [
395                 "comment" => "global contacts",
396                 "fields" => [
397                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
398                         "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"],
399                         "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"],
400                         "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the contacts profile page"],
401                         "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
402                         "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the profile photo"],
403                         "connect" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
404                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
405                         "updated" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
406                         "last_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
407                         "last_failure" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
408                         "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
409                         "about" => ["type" => "text", "comment" => ""],
410                         "keywords" => ["type" => "text", "comment" => "puplic keywords (interests)"],
411                         "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
412                         "birthday" => ["type" => "varchar(32)", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""],
413                         "community" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if contact is forum account"],
414                         "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "-1", "comment" => ""],
415                         "hide" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = should be hidden from search"],
416                         "nsfw" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = contact posts nsfw content"],
417                         "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "social network protocol"],
418                         "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
419                         "notify" => ["type" => "varchar(255)", "comment" => ""],
420                         "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
421                         "generation" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
422                         "server_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "baseurl of the contacts server"],
423                 ],
424                 "indexes" => [
425                         "PRIMARY" => ["id"],
426                         "nurl" => ["UNIQUE", "nurl(190)"],
427                         "name" => ["name(64)"],
428                         "nick" => ["nick(32)"],
429                         "addr" => ["addr(64)"],
430                         "hide_network_updated" => ["hide", "network", "updated"],
431                         "updated" => ["updated"],
432                 ]
433         ],
434         "glink" => [
435                 "comment" => "'friends of friends' linkages derived from poco",
436                 "fields" => [
437                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
438                         "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
439                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
440                         "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
441                         "zcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
442                         "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
443                 ],
444                 "indexes" => [
445                         "PRIMARY" => ["id"],
446                         "cid_uid_gcid_zcid" => ["UNIQUE", "cid", "uid", "gcid", "zcid"],
447                         "gcid" => ["gcid"],
448                 ]
449         ],
450         "group" => [
451                 "comment" => "privacy groups, group info",
452                 "fields" => [
453                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
454                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
455                         "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the member list is not private"],
456                         "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the group has been deleted"],
457                         "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "human readable name of group"],
458                 ],
459                 "indexes" => [
460                         "PRIMARY" => ["id"],
461                         "uid" => ["uid"],
462                 ]
463         ],
464         "group_member" => [
465                 "comment" => "privacy groups, member info",
466                 "fields" => [
467                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
468                         "gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["group" => "id"], "comment" => "groups.id of the associated group"],
469                         "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id of the member assigned to the associated group"],
470                 ],
471                 "indexes" => [
472                         "PRIMARY" => ["id"],
473                         "contactid" => ["contact-id"],
474                         "gid_contactid" => ["UNIQUE", "gid", "contact-id"],
475                 ]
476         ],
477         "gserver" => [
478                 "comment" => "Global servers",
479                 "fields" => [
480                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
481                         "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
482                         "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
483                         "version" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
484                         "site_name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
485                         "info" => ["type" => "text", "comment" => ""],
486                         "register_policy" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
487                         "registered-users" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Number of registered users"],
488                         "poco" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
489                         "noscrape" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
490                         "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
491                         "platform" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
492                         "relay-subscribe" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Has the server subscribed to the relay system"],
493                         "relay-scope" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => "The scope of messages that the server wants to get"],
494                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
495                         "last_poco_query" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
496                         "last_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
497                         "last_failure" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
498                 ],
499                 "indexes" => [
500                         "PRIMARY" => ["id"],
501                         "nurl" => ["UNIQUE", "nurl(190)"],
502                 ]
503         ],
504         "gserver-tag" => [
505                 "comment" => "Tags that the server has subscribed",
506                 "fields" => [
507                         "gserver-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gserver" => "id"], "primary" => "1",
508                                 "comment" => "The id of the gserver"],
509                         "tag" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "primary" => "1", "comment" => "Tag that the server has subscribed"],
510                 ],
511                 "indexes" => [
512                         "PRIMARY" => ["gserver-id", "tag"],
513                         "tag" => ["tag"],
514                 ]
515         ],
516         "hook" => [
517                 "comment" => "addon hook registry",
518                 "fields" => [
519                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
520                         "hook" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => "name of hook"],
521                         "file" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "relative filename of hook handler"],
522                         "function" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "function name of hook handler"],
523                         "priority" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => "not yet implemented - can be used to sort conflicts in hook handling by calling handlers in priority order"],
524                 ],
525                 "indexes" => [
526                         "PRIMARY" => ["id"],
527                         "hook_file_function" => ["UNIQUE", "hook", "file", "function"],
528                 ]
529         ],
530         "intro" => [
531                 "comment" => "",
532                 "fields" => [
533                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
534                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
535                         "fid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["fcontact" => "id"], "comment" => ""],
536                         "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
537                         "knowyou" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
538                         "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
539                         "note" => ["type" => "text", "comment" => ""],
540                         "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
541                         "datetime" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
542                         "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
543                         "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
544                 ],
545                 "indexes" => [
546                         "PRIMARY" => ["id"],
547                 ]
548         ],
549         "item" => [
550                 "comment" => "Structure for all posts",
551                 "fields" => [
552                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
553                         "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this item"],
554                         "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
555                         "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
556                         "uri-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
557                         "parent" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id of the parent to this item if it is a reply of some form; otherwise this must be set to the id of this item"],
558                         "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "uri of the parent to this item"],
559                         "parent-uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the parent uri"],
560                         "thr-parent" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "If the parent of this item is not the top-level item in the conversation, the uri of the immediate parent; otherwise set to parent-uri"],
561                         "thr-parent-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"],
562                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation timestamp."],
563                         "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last edit (default is created)"],
564                         "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last comment/reply to this item"],
565                         "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime"],
566                         "changed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date that something in the conversation changed, indicating clients should fetch the conversation again"],
567                         "gravity" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
568                         "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network from where the item comes from"],
569                         "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Link to the contact table with uid=0 of the owner of this item"],
570                         "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Link to the contact table with uid=0 of the author of this item"],
571                         "icid" => ["type" => "int unsigned", "relation" => ["item-content" => "id"], "comment" => "Id of the item-content table entry that contains the whole item content"],
572                         "iaid" => ["type" => "int unsigned", "relation" => ["item-activity" => "id"], "comment" => "Id of the item-activity table entry that contains the activity data"],
573                         "extid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
574                         "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"],
575                         "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
576                         "private" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "distribution is restricted"],
577                         "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
578                         "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
579                         "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been deleted"],
580                         // User specific fields. Eventually they will move to user-item
581                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
582                         "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
583                         "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "This item was posted to the wall of uid"],
584                         "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item originated at this site"],
585                         "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
586                         "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been favourited"],
587                         "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "item has not been seen"],
588                         "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "The owner of this item was mentioned in it"],
589                         "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
590                         "psid" => ["type" => "int unsigned", "relation" => ["permissionset" => "id"], "comment" => "ID of the permission set of this post"],
591                         // It has to be decided whether these fields belong to the user or the structure
592                         "resource-id" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Used to link other tables to items, it identifies the linked resource (e.g. photo) and if set must also set resource_type"],
593                         "event-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["event" => "id"], "comment" => "Used to link to the event.id"],
594                         // Could possibly be replaced by the "attach" table?
595                         "attach" => ["type" => "mediumtext", "comment" => "JSON structure representing attachments to this item"],
596                         // Deprecated fields. Will be removed in upcoming versions
597                         "allow_cid" => ["type" => "mediumtext", "comment" => "Deprecated"],
598                         "allow_gid" => ["type" => "mediumtext", "comment" => "Deprecated"],
599                         "deny_cid" => ["type" => "mediumtext", "comment" => "Deprecated"],
600                         "deny_gid" => ["type" => "mediumtext", "comment" => "Deprecated"],
601                         "postopts" => ["type" => "text", "comment" => "Deprecated"],
602                         "inform" => ["type" => "mediumtext", "comment" => "Deprecated"],
603                         "type" => ["type" => "varchar(20)", "comment" => "Deprecated"],
604                         "bookmark" => ["type" => "boolean", "comment" => "Deprecated"],
605                         "file" => ["type" => "mediumtext", "comment" => "Deprecated"],
606                         "location" => ["type" => "varchar(255)", "comment" => "Deprecated"],
607                         "coord" => ["type" => "varchar(255)", "comment" => "Deprecated"],
608                         "tag" => ["type" => "mediumtext", "comment" => "Deprecated"],
609                         "plink" => ["type" => "varchar(255)", "comment" => "Deprecated"],
610                         "title" => ["type" => "varchar(255)", "comment" => "Deprecated"],
611                         "content-warning" => ["type" => "varchar(255)", "comment" => "Deprecated"],
612                         "body" => ["type" => "mediumtext", "comment" => "Deprecated"],
613                         "app" => ["type" => "varchar(255)", "comment" => "Deprecated"],
614                         "verb" => ["type" => "varchar(100)", "comment" => "Deprecated"],
615                         "object-type" => ["type" => "varchar(100)", "comment" => "Deprecated"],
616                         "object" => ["type" => "text", "comment" => "Deprecated"],
617                         "target-type" => ["type" => "varchar(100)", "comment" => "Deprecated"],
618                         "target" => ["type" => "text", "comment" => "Deprecated"],
619                         "author-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
620                         "author-link" => ["type" => "varchar(255)", "comment" => "Deprecated"],
621                         "author-avatar" => ["type" => "varchar(255)", "comment" => "Deprecated"],
622                         "owner-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
623                         "owner-link" => ["type" => "varchar(255)", "comment" => "Deprecated"],
624                         "owner-avatar" => ["type" => "varchar(255)", "comment" => "Deprecated"],
625                         "rendered-hash" => ["type" => "varchar(32)", "comment" => "Deprecated"],
626                         "rendered-html" => ["type" => "mediumtext", "comment" => "Deprecated"],
627                 ],
628                 "indexes" => [
629                         "PRIMARY" => ["id"],
630                         "guid" => ["guid(191)"],
631                         "uri" => ["uri(191)"],
632                         "parent" => ["parent"],
633                         "parent-uri" => ["parent-uri(191)"],
634                         "extid" => ["extid(191)"],
635                         "uid_id" => ["uid", "id"],
636                         "uid_contactid_id" => ["uid", "contact-id", "id"],
637                         "uid_created" => ["uid", "created"],
638                         "uid_commented" => ["uid", "commented"],
639                         "uid_unseen_contactid" => ["uid", "unseen", "contact-id"],
640                         "uid_network_received" => ["uid", "network", "received"],
641                         "uid_network_commented" => ["uid", "network", "commented"],
642                         "uid_thrparent" => ["uid", "thr-parent(190)"],
643                         "uid_parenturi" => ["uid", "parent-uri(190)"],
644                         "uid_contactid_created" => ["uid", "contact-id", "created"],
645                         "authorid_created" => ["author-id", "created"],
646                         "ownerid" => ["owner-id"],
647                         "contact-id" => ["contact-id"],
648                         "uid_uri" => ["uid", "uri(190)"],
649                         "resource-id" => ["resource-id"],
650                         "deleted_changed" => ["deleted", "changed"],
651                         "uid_wall_changed" => ["uid", "wall", "changed"],
652                         "uid_eventid" => ["uid", "event-id"],
653                         "icid" => ["icid"],
654                         "iaid" => ["iaid"],
655                         "psid_wall" => ["psid", "wall"],
656                 ]
657         ],
658         "item-activity" => [
659                 "comment" => "Activities for items",
660                 "fields" => [
661                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
662                         "uri" => ["type" => "varchar(255)", "comment" => ""],
663                         "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
664                         "uri-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
665                         "activity" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""]
666                 ],
667                 "indexes" => [
668                         "PRIMARY" => ["id"],
669                         "uri-hash" => ["UNIQUE", "uri-hash"],
670                         "uri" => ["uri(191)"],
671                         "uri-id" => ["uri-id"]
672                 ]
673         ],
674         "item-content" => [
675                 "comment" => "Content for all posts",
676                 "fields" => [
677                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
678                         "uri" => ["type" => "varchar(255)", "comment" => ""],
679                         "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
680                         "uri-plink-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
681                         "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "item title"],
682                         "content-warning" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
683                         "body" => ["type" => "mediumtext", "comment" => "item body content"],
684                         "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "text location where this item originated"],
685                         "coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "longitude/latitude pair representing location where this item originated"],
686                         "language" => ["type" => "text", "comment" => "Language information about this post"],
687                         "app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "application which generated this item"],
688                         "rendered-hash" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
689                         "rendered-html" => ["type" => "mediumtext", "comment" => "item.body converted to html"],
690                         "object-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams object type"],
691                         "object" => ["type" => "text", "comment" => "JSON encoded object structure unless it is an implied object (normal post)"],
692                         "target-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams target type if applicable (URI)"],
693                         "target" => ["type" => "text", "comment" => "JSON encoded target structure if used"],
694                         "plink" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "permalink or URL to a displayable copy of the message at its source"],
695                         "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams verb"]
696                 ],
697                 "indexes" => [
698                         "PRIMARY" => ["id"],
699                         "uri-plink-hash" => ["UNIQUE", "uri-plink-hash"],
700                         "uri" => ["uri(191)"],
701                         "uri-id" => ["uri-id"]
702                 ]
703         ],
704         "item-delivery-data" => [
705                 "comment" => "Delivery data for items",
706                 "fields" => [
707                         "iid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["item" => "id"], "comment" => "Item id"],
708                         "postopts" => ["type" => "text", "comment" => "External post connectors add their network name to this comma-separated string to identify that they should be delivered to these networks during delivery"],
709                         "inform" => ["type" => "mediumtext", "comment" => "Additional receivers of the linked item"],
710                         "queue_count" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Initial number of delivery recipients, used as item.delivery_queue_count"],
711                         "queue_done" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries, used as item.delivery_queue_done"],
712                 ],
713                 "indexes" => [
714                         "PRIMARY" => ["iid"],
715                 ]
716         ],
717         "item-uri" => [
718                 "comment" => "URI and GUID for items",
719                 "fields" => [
720                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
721                         "uri" => ["type" => "varbinary(255)", "not null" => "1", "comment" => "URI of an item"],
722                         "guid" => ["type" => "varbinary(255)", "comment" => "A unique identifier for an item"]
723                 ],
724                 "indexes" => [
725                         "PRIMARY" => ["id"],
726                         "uri" => ["UNIQUE", "uri"],
727                         "guid" => ["guid"]
728                 ]
729         ],
730         "locks" => [
731                 "comment" => "",
732                 "fields" => [
733                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
734                         "name" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => ""],
735                         "locked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
736                         "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process ID"],
737                         "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
738                 ],
739                 "indexes" => [
740                         "PRIMARY" => ["id"],
741                         "name_expires" => ["name", "expires"]
742                 ]
743         ],
744         "mail" => [
745                 "comment" => "private messages",
746                 "fields" => [
747                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
748                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
749                         "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this private message"],
750                         "from-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "name of the sender"],
751                         "from-photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "contact photo link of the sender"],
752                         "from-url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "profile linke of the sender"],
753                         "contact-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "relation" => ["contact" => "id"], "comment" => "contact.id"],
754                         "convid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["conv" => "id"], "comment" => "conv.id"],
755                         "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
756                         "body" => ["type" => "mediumtext", "comment" => ""],
757                         "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if message visited it is 1"],
758                         "reply" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
759                         "replied" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
760                         "unknown" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if sender not in the contact table this is 1"],
761                         "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
762                         "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
763                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time of the private message"],
764                 ],
765                 "indexes" => [
766                         "PRIMARY" => ["id"],
767                         "uid_seen" => ["uid", "seen"],
768                         "convid" => ["convid"],
769                         "uri" => ["uri(64)"],
770                         "parent-uri" => ["parent-uri(64)"],
771                         "contactid" => ["contact-id(32)"],
772                 ]
773         ],
774         "mailacct" => [
775                 "comment" => "Mail account data for fetching mails",
776                 "fields" => [
777                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
778                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
779                         "server" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
780                         "port" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
781                         "ssltype" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
782                         "mailbox" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
783                         "user" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
784                         "pass" => ["type" => "text", "comment" => ""],
785                         "reply_to" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
786                         "action" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
787                         "movetofolder" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
788                         "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
789                         "last_check" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
790                 ],
791                 "indexes" => [
792                         "PRIMARY" => ["id"],
793                 ]
794         ],
795         "manage" => [
796                 "comment" => "table of accounts that can manage each other",
797                 "fields" => [
798                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
799                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
800                         "mid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
801                 ],
802                 "indexes" => [
803                         "PRIMARY" => ["id"],
804                         "uid_mid" => ["UNIQUE", "uid", "mid"],
805                 ]
806         ],
807         "notify" => [
808                 "comment" => "notifications",
809                 "fields" => [
810                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
811                         "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => ""],
812                         "type" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
813                         "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
814                         "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
815                         "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
816                         "date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
817                         "msg" => ["type" => "mediumtext", "comment" => ""],
818                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
819                         "link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
820                         "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id"],
821                         "parent" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
822                         "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
823                         "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""],
824                         "otype" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => ""],
825                         "name_cache" => ["type" => "tinytext", "comment" => "Cached bbcode parsing of name"],
826                         "msg_cache" => ["type" => "mediumtext", "comment" => "Cached bbcode parsing of msg"]
827                 ],
828                 "indexes" => [
829                         "PRIMARY" => ["id"],
830                         "hash_uid" => ["hash", "uid"],
831                         "seen_uid_date" => ["seen", "uid", "date"],
832                         "uid_date" => ["uid", "date"],
833                         "uid_type_link" => ["uid", "type", "link(190)"],
834                 ]
835         ],
836         "notify-threads" => [
837                 "comment" => "",
838                 "fields" => [
839                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
840                         "notify-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["notify" => "id"], "comment" => ""],
841                         "master-parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"],
842                                 "comment" => ""],
843                         "parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
844                         "receiver-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"],
845                                 "comment" => "User id"],
846                 ],
847                 "indexes" => [
848                         "PRIMARY" => ["id"],
849                 ]
850         ],
851         "oembed" => [
852                 "comment" => "cache for OEmbed queries",
853                 "fields" => [
854                         "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
855                         "maxwidth" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "comment" => "Maximum width passed to Oembed"],
856                         "content" => ["type" => "mediumtext", "comment" => "OEmbed data of the page"],
857                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
858                 ],
859                 "indexes" => [
860                         "PRIMARY" => ["url", "maxwidth"],
861                         "created" => ["created"],
862                 ]
863         ],
864         "openwebauth-token" => [
865                 "comment" => "Store OpenWebAuth token to verify contacts",
866                 "fields" => [
867                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
868                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
869                         "type" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Verify type"],
870                         "token" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A generated token"],
871                         "meta" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
872                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
873                 ],
874                 "indexes" => [
875                         "PRIMARY" => ["id"],
876                 ]
877         ],
878         "parsed_url" => [
879                 "comment" => "cache for 'parse_url' queries",
880                 "fields" => [
881                         "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
882                         "guessing" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the 'guessing' mode active?"],
883                         "oembed" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the data the result of oembed?"],
884                         "content" => ["type" => "mediumtext", "comment" => "page data"],
885                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
886                 ],
887                 "indexes" => [
888                         "PRIMARY" => ["url", "guessing", "oembed"],
889                         "created" => ["created"],
890                 ]
891         ],
892         "participation" => [
893                 "comment" => "Storage for participation messages from Diaspora",
894                 "fields" => [
895                         "iid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["item" => "id"], "comment" => ""],
896                         "server" => ["type" => "varchar(60)", "not null" => "1", "primary" => "1", "comment" => ""],
897                         "cid" => ["type" => "int unsigned", "not null" => "1", "relation" => ["contact" => "id"], "comment" => ""],
898                         "fid" => ["type" => "int unsigned", "not null" => "1", "relation" => ["fcontact" => "id"], "comment" => ""],
899                 ],
900                 "indexes" => [
901                         "PRIMARY" => ["iid", "server"],
902                         "cid" => ["cid"],
903                         "fid" => ["fid"]
904                 ]
905         ],
906         "pconfig" => [
907                 "comment" => "personal (per user) configuration storage",
908                 "fields" => [
909                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
910                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
911                         "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
912                         "k" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => ""],
913                         "v" => ["type" => "mediumtext", "comment" => ""],
914                 ],
915                 "indexes" => [
916                         "PRIMARY" => ["id"],
917                         "uid_cat_k" => ["UNIQUE", "uid", "cat", "k"],
918                 ]
919         ],
920         "permissionset" => [
921                 "comment" => "",
922                 "fields" => [
923                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
924                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner id of this permission set"],
925                         "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
926                         "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
927                         "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
928                         "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
929                 ],
930                 "indexes" => [
931                         "PRIMARY" => ["id"],
932                         "uid_allow_cid_allow_gid_deny_cid_deny_gid" => ["allow_cid(50)", "allow_gid(30)", "deny_cid(50)", "deny_gid(30)"],
933                 ]
934         ],
935         "photo" => [
936                 "comment" => "photo storage",
937                 "fields" => [
938                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
939                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
940                         "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
941                         "guid" => ["type" => "char(16)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this photo"],
942                         "resource-id" => ["type" => "char(32)", "not null" => "1", "default" => "", "comment" => ""],
943                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation date"],
944                         "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edited date"],
945                         "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
946                         "desc" => ["type" => "text", "comment" => ""],
947                         "album" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "The name of the album to which the photo belongs"],
948                         "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
949                         "type" => ["type" => "varchar(30)", "not null" => "1", "default" => "image/jpeg"],
950                         "height" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
951                         "width" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
952                         "datasize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
953                         "data" => ["type" => "mediumblob", "not null" => "1", "comment" => ""],
954                         "scale" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
955                         "profile" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
956                         "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
957                         "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
958                         "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
959                         "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
960                         "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
961                         "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"]
962                 ],
963                 "indexes" => [
964                         "PRIMARY" => ["id"],
965                         "contactid" => ["contact-id"],
966                         "uid_contactid" => ["uid", "contact-id"],
967                         "uid_profile" => ["uid", "profile"],
968                         "uid_album_scale_created" => ["uid", "album(32)", "scale", "created"],
969                         "uid_album_resource-id_created" => ["uid", "album(32)", "resource-id", "created"],
970                         "resource-id" => ["resource-id"],
971                 ]
972         ],
973         "poll" => [
974                 "comment" => "Currently unused table for storing poll results",
975                 "fields" => [
976                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
977                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
978                         "q0" => ["type" => "text", "comment" => ""],
979                         "q1" => ["type" => "text", "comment" => ""],
980                         "q2" => ["type" => "text", "comment" => ""],
981                         "q3" => ["type" => "text", "comment" => ""],
982                         "q4" => ["type" => "text", "comment" => ""],
983                         "q5" => ["type" => "text", "comment" => ""],
984                         "q6" => ["type" => "text", "comment" => ""],
985                         "q7" => ["type" => "text", "comment" => ""],
986                         "q8" => ["type" => "text", "comment" => ""],
987                         "q9" => ["type" => "text", "comment" => ""],
988                 ],
989                 "indexes" => [
990                         "PRIMARY" => ["id"],
991                         "uid" => ["uid"],
992                 ]
993         ],
994         "poll_result" => [
995                 "comment" => "data for polls - currently unused",
996                 "fields" => [
997                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
998                         "poll_id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["poll" => "id"]],
999                         "choice" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1000                 ],
1001                 "indexes" => [
1002                         "PRIMARY" => ["id"],
1003                         "poll_id" => ["poll_id"],
1004                 ]
1005         ],
1006         "process" => [
1007                 "comment" => "Currently running system processes",
1008                 "fields" => [
1009                         "pid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "comment" => ""],
1010                         "command" => ["type" => "varbinary(32)", "not null" => "1", "default" => "", "comment" => ""],
1011                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1012                 ],
1013                 "indexes" => [
1014                         "PRIMARY" => ["pid"],
1015                         "command" => ["command"],
1016                 ]
1017         ],
1018         "profile" => [
1019                 "comment" => "user profiles data",
1020                 "fields" => [
1021                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1022                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
1023                         "profile-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name of the profile"],
1024                         "is-default" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Mark this profile as default profile"],
1025                         "hide-friends" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide friend list from viewers of this profile"],
1026                         "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1027                         "pdesc" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Title or description"],
1028                         "dob" => ["type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00", "comment" => "Day of birth"],
1029                         "address" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1030                         "locality" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1031                         "region" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1032                         "postal-code" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1033                         "country-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1034                         "hometown" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1035                         "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1036                         "marital" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1037                         "with" => ["type" => "text", "comment" => ""],
1038                         "howlong" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1039                         "sexual" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1040                         "politic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1041                         "religion" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1042                         "pub_keywords" => ["type" => "text", "comment" => ""],
1043                         "prv_keywords" => ["type" => "text", "comment" => ""],
1044                         "likes" => ["type" => "text", "comment" => ""],
1045                         "dislikes" => ["type" => "text", "comment" => ""],
1046                         "about" => ["type" => "text", "comment" => ""],
1047                         "summary" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1048                         "music" => ["type" => "text", "comment" => ""],
1049                         "book" => ["type" => "text", "comment" => ""],
1050                         "tv" => ["type" => "text", "comment" => ""],
1051                         "film" => ["type" => "text", "comment" => ""],
1052                         "interest" => ["type" => "text", "comment" => ""],
1053                         "romance" => ["type" => "text", "comment" => ""],
1054                         "work" => ["type" => "text", "comment" => ""],
1055                         "education" => ["type" => "text", "comment" => ""],
1056                         "contact" => ["type" => "text", "comment" => ""],
1057                         "homepage" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1058                         "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1059                         "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1060                         "thumb" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1061                         "publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish default profile in local directory"],
1062                         "net-publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish profile in global directory"],
1063                 ],
1064                 "indexes" => [
1065                         "PRIMARY" => ["id"],
1066                         "uid_is-default" => ["uid", "is-default"],
1067                         "pub_keywords" => ["FULLTEXT", "pub_keywords"],
1068                 ]
1069         ],
1070         "profile_check" => [
1071                 "comment" => "DFRN remote auth use",
1072                 "fields" => [
1073                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1074                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1075                         "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
1076                         "dfrn_id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1077                         "sec" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1078                         "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1079                 ],
1080                 "indexes" => [
1081                         "PRIMARY" => ["id"],
1082                 ]
1083         ],
1084         "push_subscriber" => [
1085                 "comment" => "Used for OStatus: Contains feed subscribers",
1086                 "fields" => [
1087                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1088                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1089                         "callback_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1090                         "topic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1091                         "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1092                         "push" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1093                         "last_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last successful trial"],
1094                         "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1095                         "renewed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last subscription renewal"],
1096                         "secret" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1097                 ],
1098                 "indexes" => [
1099                         "PRIMARY" => ["id"],
1100                         "next_try" => ["next_try"],
1101                 ]
1102         ],
1103         "queue" => [
1104                 "comment" => "Queue for messages that couldn't be delivered",
1105                 "fields" => [
1106                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1107                         "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Message receiver"],
1108                         "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Receiver's network"],
1109                         "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Unique GUID of the message"],
1110                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date, when the message was created"],
1111                         "last" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last trial"],
1112                         "next" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1113                         "retrial" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1114                         "content" => ["type" => "mediumtext", "comment" => ""],
1115                         "batch" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1116                 ],
1117                 "indexes" => [
1118                         "PRIMARY" => ["id"],
1119                         "last" => ["last"],
1120                         "next" => ["next"],
1121                 ]
1122         ],
1123         "register" => [
1124                 "comment" => "registrations requiring admin approval",
1125                 "fields" => [
1126                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1127                         "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1128                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1129                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1130                         "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1131                         "language" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
1132                         "note" => ["type" => "text", "comment" => ""],
1133                 ],
1134                 "indexes" => [
1135                         "PRIMARY" => ["id"],
1136                 ]
1137         ],
1138         "search" => [
1139                 "comment" => "",
1140                 "fields" => [
1141                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1142                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1143                         "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1144                 ],
1145                 "indexes" => [
1146                         "PRIMARY" => ["id"],
1147                         "uid" => ["uid"],
1148                 ]
1149         ],
1150         "session" => [
1151                 "comment" => "web session storage",
1152                 "fields" => [
1153                         "id" => ["type" => "bigint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1154                         "sid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
1155                         "data" => ["type" => "text", "comment" => ""],
1156                         "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1157                 ],
1158                 "indexes" => [
1159                         "PRIMARY" => ["id"],
1160                         "sid" => ["sid(64)"],
1161                         "expire" => ["expire"],
1162                 ]
1163         ],
1164         "sign" => [
1165                 "comment" => "Diaspora signatures",
1166                 "fields" => [
1167                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1168                         "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id"],
1169                         "signed_text" => ["type" => "mediumtext", "comment" => ""],
1170                         "signature" => ["type" => "text", "comment" => ""],
1171                         "signer" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1172                 ],
1173                 "indexes" => [
1174                         "PRIMARY" => ["id"],
1175                         "iid" => ["UNIQUE", "iid"],
1176                 ]
1177         ],
1178         "term" => [
1179                 "comment" => "item taxonomy (categories, tags, etc.) table",
1180                 "fields" => [
1181                         "tid" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
1182                         "oid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
1183                         "otype" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1184                         "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1185                         "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1186                         "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1187                         "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1188                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1189                         "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1190                         "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1191                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1192                 ],
1193                 "indexes" => [
1194                         "PRIMARY" => ["tid"],
1195                         "oid_otype_type_term" => ["oid", "otype", "type", "term(32)"],
1196                         "uid_otype_type_term_global_created" => ["uid", "otype", "type", "term(32)", "global", "created"],
1197                         "uid_otype_type_url" => ["uid", "otype", "type", "url(64)"],
1198                         "guid" => ["guid(64)"],
1199                 ]
1200         ],
1201         "thread" => [
1202                 "comment" => "Thread related data",
1203                 "fields" => [
1204                         "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"],
1205                                 "comment" => "sequential ID"],
1206                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1207                         "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
1208                         "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item owner"],
1209                         "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item author"],
1210                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1211                         "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1212                         "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1213                         "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1214                         "changed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1215                         "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1216                         "private" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1217                         "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1218                         "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1219                         "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1220                         "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1221                         "ignored" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1222                         "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"],
1223                         "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
1224                         "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1225                         "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1226                         "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1227                         "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1228                         "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
1229                         "bookmark" => ["type" => "boolean", "comment" => ""],
1230                 ],
1231                 "indexes" => [
1232                         "PRIMARY" => ["iid"],
1233                         "uid_network_commented" => ["uid", "network", "commented"],
1234                         "uid_network_created" => ["uid", "network", "created"],
1235                         "uid_contactid_commented" => ["uid", "contact-id", "commented"],
1236                         "uid_contactid_created" => ["uid", "contact-id", "created"],
1237                         "contactid" => ["contact-id"],
1238                         "ownerid" => ["owner-id"],
1239                         "authorid" => ["author-id"],
1240                         "uid_created" => ["uid", "created"],
1241                         "uid_commented" => ["uid", "commented"],
1242                         "uid_wall_created" => ["uid", "wall", "created"],
1243                         "private_wall_origin_commented" => ["private", "wall", "origin", "commented"],
1244                 ]
1245         ],
1246         "tokens" => [
1247                 "comment" => "OAuth usage",
1248                 "fields" => [
1249                         "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""],
1250                         "secret" => ["type" => "text", "comment" => ""],
1251                         "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "relation" => ["clients" => "client_id"]],
1252                         "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
1253                         "scope" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
1254                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1255                 ],
1256                 "indexes" => [
1257                         "PRIMARY" => ["id"],
1258                 ]
1259         ],
1260         "user" => [
1261                 "comment" => "The local users",
1262                 "fields" => [
1263                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1264                         "parent-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"],
1265                                 "comment" => "The parent user that has full control about this user"],
1266                         "guid" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this user"],
1267                         "username" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this user is known by"],
1268                         "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "encrypted password"],
1269                         "legacy_password" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the password hash double-hashed?"],
1270                         "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "nick- and user name"],
1271                         "email" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "the users email address"],
1272                         "openid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1273                         "timezone" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => "PHP-legal timezone"],
1274                         "language" => ["type" => "varchar(32)", "not null" => "1", "default" => "en", "comment" => "default language"],
1275                         "register_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of registration"],
1276                         "login_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last login"],
1277                         "default-location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Default for item.location"],
1278                         "allow_location" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 allows to display the location"],
1279                         "theme" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "user theme preference"],
1280                         "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
1281                         "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
1282                         "spubkey" => ["type" => "text", "comment" => ""],
1283                         "sprvkey" => ["type" => "text", "comment" => ""],
1284                         "verified" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "user is verified through email"],
1285                         "blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 for user is blocked"],
1286                         "blockwall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to post to the profile page of the user"],
1287                         "hidewall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide profile details from unkown viewers"],
1288                         "blocktags" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to tag the post of this user"],
1289                         "unkmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Permit unknown people to send private mails to this user"],
1290                         "cntunkmail" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
1291                         "notify-flags" => ["type" => "smallint unsigned", "not null" => "1", "default" => "65535", "comment" => "email notification options"],
1292                         "page-flags" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "page/profile type"],
1293                         "account-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1294                         "prvnets" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1295                         "pwdreset" => ["type" => "varchar(255)", "comment" => "Password reset request token"],
1296                         "pwdreset_time" => ["type" => "datetime", "comment" => "Timestamp of the last password reset request"],
1297                         "maxreq" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
1298                         "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1299                         "account_removed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if 1 the account is removed"],
1300                         "account_expired" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1301                         "account_expires_on" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp when account expires and will be deleted"],
1302                         "expire_notification_sent" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last warning of account expiration"],
1303                         "def_gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1304                         "allow_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1305                         "allow_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1306                         "deny_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1307                         "deny_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1308                         "openidserver" => ["type" => "text", "comment" => ""],
1309                 ],
1310                 "indexes" => [
1311                         "PRIMARY" => ["uid"],
1312                         "nickname" => ["nickname(32)"],
1313                 ]
1314         ],
1315         "userd" => [
1316                 "comment" => "Deleted usernames",
1317                 "fields" => [
1318                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1319                         "username" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
1320                 ],
1321                 "indexes" => [
1322                         "PRIMARY" => ["id"],
1323                         "username" => ["username(32)"],
1324                 ]
1325         ],
1326         "user-contact" => [
1327                 "comment" => "User specific public contact data",
1328                 "fields" => [
1329                         "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["contact" => "id"], "comment" => "Contact id of the linked public contact"],
1330                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
1331                         "blocked" => ["type" => "boolean", "comment" => "Contact is completely blocked for this user"],
1332                         "ignored" => ["type" => "boolean", "comment" => "Posts from this contact are ignored"],
1333                         "collapsed" => ["type" => "boolean", "comment" => "Posts from this contact are collapsed"]
1334                 ],
1335                 "indexes" => [
1336                         "PRIMARY" => ["uid", "cid"]
1337                 ]
1338         ],
1339         "user-item" => [
1340                 "comment" => "User specific item data",
1341                 "fields" => [
1342                         "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"], "comment" => "Item id"],
1343                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
1344                         "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide an item from the user"],
1345                         "ignored" => ["type" => "boolean", "comment" => "Ignore this thread if set"]
1346                 ],
1347                 "indexes" => [
1348                         "PRIMARY" => ["uid", "iid"]
1349                 ]
1350         ],
1351         "worker-ipc" => [
1352                 "comment" => "Inter process communication between the frontend and the worker",
1353                 "fields" => [
1354                         "key" => ["type" => "int", "not null" => "1", "primary" => "1", "comment" => ""],
1355                         "jobs" => ["type" => "boolean", "comment" => "Flag for outstanding jobs"],
1356                 ],
1357                 "indexes" => [
1358                         "PRIMARY" => ["key"],
1359                 ],
1360                 "engine" => "MEMORY",
1361         ],
1362         "workerqueue" => [
1363                 "comment" => "Background tasks queue entries",
1364                 "fields" => [
1365                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented worker task id"],
1366                         "parameter" => ["type" => "mediumblob", "comment" => "Task command"],
1367                         "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Task priority"],
1368                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date"],
1369                         "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process id of the worker"],
1370                         "executed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Execution date"],
1371                         "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1372                         "retrial" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1373                         "done" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marked 1 when the task was done - will be deleted later"],
1374                 ],
1375                 "indexes" => [
1376                         "PRIMARY" => ["id"],
1377                         "pid" => ["pid"],
1378                         "parameter" => ["parameter(64)"],
1379                         "priority_created_next_try" => ["priority", "created", "next_try"],
1380                         "done_priority_executed_next_try" => ["done", "priority", "executed", "next_try"],
1381                         "done_executed_next_try" => ["done", "executed", "next_try"],
1382                         "done_priority_next_try" => ["done", "priority", "next_try"],
1383                         "done_next_try" => ["done", "next_try"]
1384                 ]
1385         ],
1386         "storage" => [
1387                 "comment" => "Data stored by Database storage backend",
1388                 "fields" => [
1389                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented image data id"],
1390                         "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"]
1391                 ],
1392                 "indexes" => [
1393                         "PRIMARY" => ["id"]
1394                 ]
1395         ]
1396 ];
1397