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