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