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