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