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