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