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