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