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