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