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