]> git.mxchange.org Git - friendica.git/blob - static/dbstructure.config.php
Fix the spelling
[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', 1468);
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-marker" => [
453                 "comment" => "Timeline marker",
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                         "timeline" => ["type" => "varchar(64)", "not null" => "1", "primary" => "1", "comment" => "Marker (home, notifications)"],
458                         "last_read_id" => ["type" => "varchar(255)", "comment" => "Marker id for the timeline"],
459                         "version" => ["type" => "smallint unsigned", "comment" => "Version number"],
460                         "updated_at" => ["type" => "datetime", "comment" => "creation time"],
461                 ],
462                 "indexes" => [
463                         "PRIMARY" => ["application-id", "uid", "timeline"],
464                         "uid_id" => ["uid"],
465                 ]
466         ],
467         "application-token" => [
468                 "comment" => "OAuth user token",
469                 "fields" => [
470                         "application-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["application" => "id"], "comment" => ""],
471                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
472                         "code" => ["type" => "varchar(64)", "not null" => "1", "comment" => ""],
473                         "access_token" => ["type" => "varchar(64)", "not null" => "1", "comment" => ""],
474                         "created_at" => ["type" => "datetime", "not null" => "1", "comment" => "creation time"],
475                         "scopes" => ["type" => "varchar(255)", "comment" => ""],
476                         "read" => ["type" => "boolean", "comment" => "Read scope"],
477                         "write" => ["type" => "boolean", "comment" => "Write scope"],
478                         "follow" => ["type" => "boolean", "comment" => "Follow scope"],
479                         "push" => ["type" => "boolean", "comment" => "Push scope"],
480                 ],
481                 "indexes" => [
482                         "PRIMARY" => ["application-id", "uid"],
483                         "uid_id" => ["uid", "application-id"],
484                 ]
485         ],
486         "attach" => [
487                 "comment" => "file attachments",
488                 "fields" => [
489                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "generated index"],
490                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
491                         "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "hash"],
492                         "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "filename of original"],
493                         "filetype" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "mimetype"],
494                         "filesize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "size in bytes"],
495                         "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"],
496                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
497                         "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
498                         "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>"],
499                         "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
500                         "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
501                         "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
502                         "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
503                         "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"],
504                 ],
505                 "indexes" => [
506                         "PRIMARY" => ["id"],
507                         "uid" => ["uid"],
508                 ]
509         ],
510         "cache" => [
511                 "comment" => "Stores temporary data",
512                 "fields" => [
513                         "k" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "cache key"],
514                         "v" => ["type" => "mediumtext", "comment" => "cached serialized value"],
515                         "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
516                         "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache insertion"],
517                 ],
518                 "indexes" => [
519                         "PRIMARY" => ["k"],
520                         "k_expires" => ["k", "expires"],
521                 ]
522         ],
523         "config" => [
524                 "comment" => "main configuration storage",
525                 "fields" => [
526                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
527                         "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
528                         "k" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
529                         "v" => ["type" => "mediumtext", "comment" => ""],
530                 ],
531                 "indexes" => [
532                         "PRIMARY" => ["id"],
533                         "cat_k" => ["UNIQUE", "cat", "k"],
534                 ]
535         ],
536         "contact-relation" => [
537                 "comment" => "Contact relations",
538                 "fields" => [
539                         "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "primary" => "1", "comment" => "contact the related contact had interacted with"],
540                         "relation-cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "primary" => "1", "comment" => "related contact who had interacted with the contact"],
541                         "last-interaction" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last interaction"],
542                         "follow-updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last update of the contact relationship"],
543                         "follows" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
544                 ],
545                 "indexes" => [
546                         "PRIMARY" => ["cid", "relation-cid"],
547                         "relation-cid" => ["relation-cid"],
548                 ]
549         ],
550         "conv" => [
551                 "comment" => "private messages",
552                 "fields" => [
553                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
554                         "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this conversation"],
555                         "recips" => ["type" => "text", "comment" => "sender_handle;recipient_handle"],
556                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
557                         "creator" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "handle of creator"],
558                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation timestamp"],
559                         "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "edited timestamp"],
560                         "subject" => ["type" => "text", "comment" => "subject of initial message"],
561                 ],
562                 "indexes" => [
563                         "PRIMARY" => ["id"],
564                         "uid" => ["uid"],
565                 ]
566         ],
567         "conversation" => [
568                 "comment" => "Raw data and structure information for messages",
569                 "fields" => [
570                         "item-uri" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "Original URI of the item - unrelated to the table with the same name"],
571                         "reply-to-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "URI to which this item is a reply"],
572                         "conversation-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation URI"],
573                         "conversation-href" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation link"],
574                         "protocol" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "255", "comment" => "The protocol of the item"],
575                         "direction" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "How the message arrived here: 1=push, 2=pull"],
576                         "source" => ["type" => "mediumtext", "comment" => "Original source"],
577                         "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Receiving date"],
578                 ],
579                 "indexes" => [
580                         "PRIMARY" => ["item-uri"],
581                         "conversation-uri" => ["conversation-uri"],
582                         "received" => ["received"],
583                 ]
584         ],
585         "workerqueue" => [
586                 "comment" => "Background tasks queue entries",
587                 "fields" => [
588                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented worker task id"],
589                         "command" => ["type" => "varchar(100)", "comment" => "Task command"],
590                         "parameter" => ["type" => "mediumtext", "comment" => "Task parameter"],
591                         "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Task priority"],
592                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date"],
593                         "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process id of the worker"],
594                         "executed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Execution date"],
595                         "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
596                         "retrial" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
597                         "done" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marked 1 when the task was done - will be deleted later"],
598                 ],
599                 "indexes" => [
600                         "PRIMARY" => ["id"],
601                         "command" => ["command"],
602                         "done_command_parameter" => ["done", "command", "parameter(64)"],
603                         "done_executed" => ["done", "executed"],
604                         "done_priority_retrial_created" => ["done", "priority", "retrial", "created"],
605                         "done_priority_next_try" => ["done", "priority", "next_try"],
606                         "done_pid_next_try" => ["done", "pid", "next_try"],
607                         "done_pid_retrial" => ["done", "pid", "retrial"],
608                         "done_pid_priority_created" => ["done", "pid", "priority", "created"]
609                 ]
610         ],
611         "delayed-post" => [
612                 "comment" => "Posts that are about to be distributed at a later time",
613                 "fields" => [
614                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
615                         "uri" => ["type" => "varchar(255)", "comment" => "URI of the post that will be distributed later"],
616                         "uid" => ["type" => "mediumint unsigned", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
617                         "delayed" => ["type" => "datetime", "comment" => "delay time"],
618                         "wid" => ["type" => "int unsigned", "foreign" => ["workerqueue" => "id"], "comment" => "Workerqueue id"],
619                 ],
620                 "indexes" => [
621                         "PRIMARY" => ["id"],
622                         "uid_uri" => ["UNIQUE", "uid", "uri(190)"],
623                         "wid" => ["wid"],
624                 ]
625         ],
626         "diaspora-interaction" => [
627                 "comment" => "Signed Diaspora Interaction",
628                 "fields" => [
629                         "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"],
630                         "interaction" => ["type" => "mediumtext", "comment" => "The Diaspora interaction"]
631                 ],
632                 "indexes" => [
633                         "PRIMARY" => ["uri-id"]
634                 ]
635         ],
636         "endpoint" => [
637                 "comment" => "ActivityPub endpoints - used in the ActivityPub implementation",
638                 "fields" => [
639                         "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URL of the contact"],
640                         "type" => ["type" => "varchar(20)", "not null" => "1", "comment" => ""],
641                         "owner-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the apcontact url"],
642                 ],
643                 "indexes" => [
644                         "PRIMARY" => ["url"],
645                         "owner-uri-id_type" => ["UNIQUE", "owner-uri-id", "type"],
646                 ]
647         ],
648         "event" => [
649                 "comment" => "Events",
650                 "fields" => [
651                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
652                         "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
653                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
654                         "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact_id (ID of the contact in contact table)"],
655                         "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
656                         "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the event uri"],
657                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
658                         "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
659                         "start" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event start time"],
660                         "finish" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event end time"],
661                         "summary" => ["type" => "text", "comment" => "short description or title of the event"],
662                         "desc" => ["type" => "text", "comment" => "event description"],
663                         "location" => ["type" => "text", "comment" => "event location"],
664                         "type" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => "event or birthday"],
665                         "nofinish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if event does have no end this is 1"],
666                         "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "0 or 1"],
667                         "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
668                         "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
669                         "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
670                         "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
671                 ],
672                 "indexes" => [
673                         "PRIMARY" => ["id"],
674                         "uid_start" => ["uid", "start"],
675                         "cid" => ["cid"],
676                         "uri-id" => ["uri-id"],
677                 ]
678         ],
679         "fcontact" => [
680                 "comment" => "Diaspora compatible contacts - used in the Diaspora implementation",
681                 "fields" => [
682                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
683                         "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "unique id"],
684                         "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
685                         "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the fcontact url"],
686                         "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
687                         "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
688                         "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
689                         "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
690                         "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
691                         "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
692                         "notify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
693                         "poll" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
694                         "confirm" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
695                         "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
696                         "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
697                         "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
698                         "pubkey" => ["type" => "text", "comment" => ""],
699                         "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
700                         "interacting_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of contacts this contact interactes with"],
701                         "interacted_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of contacts that interacted with this contact"],
702                         "post_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of posts and comments"],
703                 ],
704                 "indexes" => [
705                         "PRIMARY" => ["id"],
706                         "addr" => ["addr(32)"],
707                         "url" => ["UNIQUE", "url(190)"],
708                         "uri-id" => ["UNIQUE", "uri-id"],
709                 ]
710         ],
711         "fsuggest" => [
712                 "comment" => "friend suggestion stuff",
713                 "fields" => [
714                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
715                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
716                         "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => ""],
717                         "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
718                         "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
719                         "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
720                         "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
721                         "note" => ["type" => "text", "comment" => ""],
722                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
723                 ],
724                 "indexes" => [
725                         "PRIMARY" => ["id"],
726                         "cid" => ["cid"],
727                         "uid" => ["uid"],
728                 ]
729         ],
730         "group" => [
731                 "comment" => "privacy groups, group info",
732                 "fields" => [
733                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
734                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
735                         "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the member list is not private"],
736                         "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the group has been deleted"],
737                         "cid" => ["type" => "int unsigned", "foreign" => ["contact" => "id"], "comment" => "Contact id of forum. When this field is filled then the members are synced automatically."],
738                         "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "human readable name of group"],
739                 ],
740                 "indexes" => [
741                         "PRIMARY" => ["id"],
742                         "uid" => ["uid"],
743                         "cid" => ["cid"],
744                 ]
745         ],
746         "group_member" => [
747                 "comment" => "privacy groups, member info",
748                 "fields" => [
749                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
750                         "gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["group" => "id"], "comment" => "groups.id of the associated group"],
751                         "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact.id of the member assigned to the associated group"],
752                 ],
753                 "indexes" => [
754                         "PRIMARY" => ["id"],
755                         "contactid" => ["contact-id"],
756                         "gid_contactid" => ["UNIQUE", "gid", "contact-id"],
757                 ]
758         ],
759         "gserver-tag" => [
760                 "comment" => "Tags that the server has subscribed",
761                 "fields" => [
762                         "gserver-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["gserver" => "id"], "primary" => "1",
763                                 "comment" => "The id of the gserver"],
764                         "tag" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "primary" => "1", "comment" => "Tag that the server has subscribed"],
765                 ],
766                 "indexes" => [
767                         "PRIMARY" => ["gserver-id", "tag"],
768                         "tag" => ["tag"],
769                 ]
770         ],
771         "hook" => [
772                 "comment" => "addon hook registry",
773                 "fields" => [
774                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
775                         "hook" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => "name of hook"],
776                         "file" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "relative filename of hook handler"],
777                         "function" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "function name of hook handler"],
778                         "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"],
779                 ],
780                 "indexes" => [
781                         "PRIMARY" => ["id"],
782                         "priority" => ["priority"],
783                         "hook_file_function" => ["UNIQUE", "hook", "file", "function"],
784                 ]
785         ],
786         "inbox-status" => [
787                 "comment" => "Status of ActivityPub inboxes",
788                 "fields" => [
789                         "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URL of the inbox"],
790                         "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of inbox url"],
791                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date of this entry"],
792                         "success" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful delivery"],
793                         "failure" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed delivery"],
794                         "previous" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Previous delivery date"],
795                         "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the inbox archived?"],
796                         "shared" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is it a shared inbox?"]
797                 ],
798                 "indexes" => [
799                         "PRIMARY" => ["url"],
800                         "uri-id" => ["uri-id"],
801                 ]
802         ],
803         "intro" => [
804                 "comment" => "",
805                 "fields" => [
806                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
807                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
808                         "fid" => ["type" => "int unsigned", "relation" => ["fcontact" => "id"], "comment" => "deprecated"],
809                         "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => ""],
810                         "suggest-cid" => ["type" => "int unsigned", "foreign" => ["contact" => "id"], "comment" => "Suggested contact"],
811                         "knowyou" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
812                         "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "deprecated"],
813                         "note" => ["type" => "text", "comment" => ""],
814                         "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
815                         "datetime" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
816                         "blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "deprecated"],
817                         "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
818                 ],
819                 "indexes" => [
820                         "PRIMARY" => ["id"],
821                         "contact-id" => ["contact-id"],
822                         "suggest-cid" => ["suggest-cid"],
823                         "uid" => ["uid"],
824                 ]
825         ],
826         "locks" => [
827                 "comment" => "",
828                 "fields" => [
829                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
830                         "name" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => ""],
831                         "locked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
832                         "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process ID"],
833                         "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
834                 ],
835                 "indexes" => [
836                         "PRIMARY" => ["id"],
837                         "name_expires" => ["name", "expires"]
838                 ]
839         ],
840         "mail" => [
841                 "comment" => "private messages",
842                 "fields" => [
843                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
844                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
845                         "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this private message"],
846                         "from-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "name of the sender"],
847                         "from-photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "contact photo link of the sender"],
848                         "from-url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "profile linke of the sender"],
849                         "contact-id" => ["type" => "varchar(255)", "relation" => ["contact" => "id"], "comment" => "contact.id"],
850                         "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"],
851                         "convid" => ["type" => "int unsigned", "relation" => ["conv" => "id"], "comment" => "conv.id"],
852                         "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
853                         "body" => ["type" => "mediumtext", "comment" => ""],
854                         "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if message visited it is 1"],
855                         "reply" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
856                         "replied" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
857                         "unknown" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if sender not in the contact table this is 1"],
858                         "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
859                         "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the related mail"],
860                         "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
861                         "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related mail"],
862                         "thr-parent" => ["type" => "varchar(255)", "comment" => ""],
863                         "thr-parent-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"],
864                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time of the private message"],
865                 ],
866                 "indexes" => [
867                         "PRIMARY" => ["id"],
868                         "uid_seen" => ["uid", "seen"],
869                         "convid" => ["convid"],
870                         "uri" => ["uri(64)"],
871                         "parent-uri" => ["parent-uri(64)"],
872                         "contactid" => ["contact-id(32)"],
873                         "author-id" => ["author-id"],
874                         "uri-id" => ["uri-id"],
875                         "parent-uri-id" => ["parent-uri-id"],
876                         "thr-parent-id" => ["thr-parent-id"],
877                 ]
878         ],
879         "mailacct" => [
880                 "comment" => "Mail account data for fetching mails",
881                 "fields" => [
882                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
883                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
884                         "server" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
885                         "port" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
886                         "ssltype" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
887                         "mailbox" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
888                         "user" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
889                         "pass" => ["type" => "text", "comment" => ""],
890                         "reply_to" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
891                         "action" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
892                         "movetofolder" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
893                         "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
894                         "last_check" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
895                 ],
896                 "indexes" => [
897                         "PRIMARY" => ["id"],
898                         "uid" => ["uid"],
899                 ]
900         ],
901         "manage" => [
902                 "comment" => "table of accounts that can manage each other",
903                 "fields" => [
904                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
905                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
906                         "mid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
907                 ],
908                 "indexes" => [
909                         "PRIMARY" => ["id"],
910                         "uid_mid" => ["UNIQUE", "uid", "mid"],
911                         "mid" => ["mid"],
912                 ]
913         ],
914         "notification" => [
915                 "comment" => "notifications",
916                 "fields" => [
917                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
918                         "uid" => ["type" => "mediumint unsigned", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
919                         "vid" => ["type" => "smallint unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"],
920                         "type" => ["type" => "smallint unsigned", "comment" => ""],
921                         "actor-id" => ["type" => "int unsigned", "foreign" => ["contact" => "id"], "comment" => "Link to the contact table with uid=0 of the actor that caused the notification"],
922                         "target-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the related post"],
923                         "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related post"],
924                         "created" => ["type" => "datetime", "comment" => ""],
925                         "seen" => ["type" => "boolean", "default" => "0", "comment" => "Seen on the desktop"],
926                         "dismissed" => ["type" => "boolean", "default" => "0", "comment" => "Dismissed via the API"],
927                 ],
928                 "indexes" => [
929                         "PRIMARY" => ["id"],
930                         "uid_vid_type_actor-id_target-uri-id" => ["UNIQUE", "uid", "vid", "type", "actor-id", "target-uri-id"],
931                         "vid" => ["vid"],
932                         "actor-id" => ["actor-id"],
933                         "target-uri-id" => ["target-uri-id"],
934                         "parent-uri-id" => ["parent-uri-id"],
935                         "seen_uid" => ["seen", "uid"],
936                 ]
937         ],
938         "notify" => [
939                 "comment" => "[Deprecated] User notifications",
940                 "fields" => [
941                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
942                         "type" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
943                         "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
944                         "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
945                         "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
946                         "date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
947                         "msg" => ["type" => "mediumtext", "comment" => ""],
948                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
949                         "link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
950                         "iid" => ["type" => "int unsigned", "comment" => ""],
951                         "parent" => ["type" => "int unsigned", "comment" => ""],
952                         "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the related post"],
953                         "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related post"],
954                         "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
955                         "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""],
956                         "otype" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => ""],
957                         "name_cache" => ["type" => "tinytext", "comment" => "Cached bbcode parsing of name"],
958                         "msg_cache" => ["type" => "mediumtext", "comment" => "Cached bbcode parsing of msg"]
959                 ],
960                 "indexes" => [
961                         "PRIMARY" => ["id"],
962                         "seen_uid_date" => ["seen", "uid", "date"],
963                         "uid_date" => ["uid", "date"],
964                         "uid_type_link" => ["uid", "type", "link(190)"],
965                         "uri-id" => ["uri-id"],
966                         "parent-uri-id" => ["parent-uri-id"],
967                 ]
968         ],
969         "notify-threads" => [
970                 "comment" => "",
971                 "fields" => [
972                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
973                         "notify-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["notify" => "id"], "comment" => ""],
974                         "master-parent-item" => ["type" => "int unsigned", "comment" => "Deprecated"],
975                         "master-parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related post"],
976                         "parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
977                         "receiver-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"],
978                                 "comment" => "User id"],
979                 ],
980                 "indexes" => [
981                         "PRIMARY" => ["id"],
982                         "master-parent-uri-id" => ["master-parent-uri-id"],
983                         "receiver-uid" => ["receiver-uid"],
984                         "notify-id" => ["notify-id"],
985                 ]
986         ],
987         "oembed" => [
988                 "comment" => "cache for OEmbed queries",
989                 "fields" => [
990                         "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
991                         "maxwidth" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "comment" => "Maximum width passed to Oembed"],
992                         "content" => ["type" => "mediumtext", "comment" => "OEmbed data of the page"],
993                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
994                 ],
995                 "indexes" => [
996                         "PRIMARY" => ["url", "maxwidth"],
997                         "created" => ["created"],
998                 ]
999         ],
1000         "openwebauth-token" => [
1001                 "comment" => "Store OpenWebAuth token to verify contacts",
1002                 "fields" => [
1003                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1004                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id - currently unused"],
1005                         "type" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Verify type"],
1006                         "token" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A generated token"],
1007                         "meta" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1008                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
1009                 ],
1010                 "indexes" => [
1011                         "PRIMARY" => ["id"],
1012                         "uid" => ["uid"],
1013                 ]
1014         ],
1015         "parsed_url" => [
1016                 "comment" => "cache for 'parse_url' queries",
1017                 "fields" => [
1018                         "url_hash" => ["type" => "binary(64)", "not null" => "1", "primary" => "1", "comment" => "page url hash"],
1019                         "guessing" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the 'guessing' mode active?"],
1020                         "oembed" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the data the result of oembed?"],
1021                         "url" => ["type" => "text", "not null" => "1", "comment" => "page url"],
1022                         "content" => ["type" => "mediumtext", "comment" => "page data"],
1023                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
1024                         "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of expiration"],
1025                 ],
1026                 "indexes" => [
1027                         "PRIMARY" => ["url_hash", "guessing", "oembed"],
1028                         "created" => ["created"],
1029                         "expires" => ["expires"],
1030                 ]
1031         ],
1032         "pconfig" => [
1033                 "comment" => "personal (per user) configuration storage",
1034                 "fields" => [
1035                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Primary key"],
1036                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1037                         "cat" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "Category"],
1038                         "k" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "Key"],
1039                         "v" => ["type" => "mediumtext", "comment" => "Value"],
1040                 ],
1041                 "indexes" => [
1042                         "PRIMARY" => ["id"],
1043                         "uid_cat_k" => ["UNIQUE", "uid", "cat", "k"],
1044                 ]
1045         ],
1046         "photo" => [
1047                 "comment" => "photo storage",
1048                 "fields" => [
1049                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1050                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid", "on delete" => "restrict"], "comment" => "Owner User id"],
1051                         "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "contact.id"],
1052                         "guid" => ["type" => "char(16)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this photo"],
1053                         "resource-id" => ["type" => "char(32)", "not null" => "1", "default" => "", "comment" => ""],
1054                         "hash" => ["type" => "char(32)", "comment" => "hash value of the photo"],
1055                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation date"],
1056                         "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edited date"],
1057                         "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1058                         "desc" => ["type" => "text", "comment" => ""],
1059                         "album" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "The name of the album to which the photo belongs"],
1060                         "photo-type" => ["type" => "tinyint unsigned", "comment" => "User avatar, user banner, contact avatar, contact banner or default"],
1061                         "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1062                         "type" => ["type" => "varchar(30)", "not null" => "1", "default" => "image/jpeg"],
1063                         "height" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1064                         "width" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1065                         "datasize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1066                         "data" => ["type" => "mediumblob", "not null" => "1", "comment" => ""],
1067                         "scale" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1068                         "profile" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1069                         "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
1070                         "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
1071                         "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
1072                         "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
1073                         "accessible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Make photo publicly accessible, ignoring permissions"],
1074                         "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
1075                         "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"],
1076                         "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
1077                 ],
1078                 "indexes" => [
1079                         "PRIMARY" => ["id"],
1080                         "contactid" => ["contact-id"],
1081                         "uid_contactid" => ["uid", "contact-id"],
1082                         "uid_profile" => ["uid", "profile"],
1083                         "uid_album_scale_created" => ["uid", "album(32)", "scale", "created"],
1084                         "uid_album_resource-id_created" => ["uid", "album(32)", "resource-id", "created"],
1085                         "resource-id" => ["resource-id"],
1086                         "uid_photo-type" => ["uid", "photo-type"],
1087                 ]
1088         ],
1089         "post" => [
1090                 "comment" => "Structure for all posts",
1091                 "fields" => [
1092                         "uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
1093                         "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the parent uri"],
1094                         "thr-parent-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"],
1095                         "external-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the external uri"],
1096                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation timestamp."],
1097                         "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last edit (default is created)"],
1098                         "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime"],
1099                         "gravity" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1100                         "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network from where the item comes from"],
1101                         "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"],
1102                         "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"],
1103                         "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"],
1104                         "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, image, article, ...)"],
1105                         "vid" => ["type" => "smallint unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"],
1106                         "private" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "0=public, 1=private, 2=unlisted"],
1107                         "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1108                         "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1109                         "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been marked for deletion"]
1110                 ],
1111                 "indexes" => [
1112                         "PRIMARY" => ["uri-id"],
1113                         "parent-uri-id" => ["parent-uri-id"],
1114                         "thr-parent-id" => ["thr-parent-id"],
1115                         "external-id" => ["external-id"],
1116                         "owner-id" => ["owner-id"],
1117                         "author-id" => ["author-id"],
1118                         "causer-id" => ["causer-id"],
1119                         "vid" => ["vid"],
1120                 ]
1121         ],
1122         "post-category" => [
1123                 "comment" => "post relation to categories",
1124                 "fields" => [
1125                         "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"],
1126                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "User id"],
1127                         "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "comment" => ""],
1128                         "tid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["tag" => "id", "on delete" => "restrict"], "comment" => ""],
1129                 ],
1130                 "indexes" => [
1131                         "PRIMARY" => ["uri-id", "uid", "type", "tid"],
1132                         "tid" => ["tid"],
1133                         "uid_uri-id" => ["uid", "uri-id"],
1134                 ]
1135         ],
1136         "post-collection" => [
1137                 "comment" => "Collection of posts",
1138                 "fields" => [
1139                         "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"],
1140                         "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "0 - Featured"],
1141                 ],
1142                 "indexes" => [
1143                         "PRIMARY" => ["uri-id", "type"],
1144                         "type" => ["type"],
1145                 ]
1146         ],
1147         "post-content" => [
1148                 "comment" => "Content for all posts",
1149                 "fields" => [
1150                         "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"],
1151                         "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "item title"],
1152                         "content-warning" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1153                         "body" => ["type" => "mediumtext", "comment" => "item body content"],
1154                         "raw-body" => ["type" => "mediumtext", "comment" => "Body without embedded media links"],
1155                         "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "text location where this item originated"],
1156                         "coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "longitude/latitude pair representing location where this item originated"],
1157                         "language" => ["type" => "text", "comment" => "Language information about this post"],
1158                         "app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "application which generated this item"],
1159                         "rendered-hash" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1160                         "rendered-html" => ["type" => "mediumtext", "comment" => "item.body converted to html"],
1161                         "object-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams object type"],
1162                         "object" => ["type" => "text", "comment" => "JSON encoded object structure unless it is an implied object (normal post)"],
1163                         "target-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams target type if applicable (URI)"],
1164                         "target" => ["type" => "text", "comment" => "JSON encoded target structure if used"],
1165                         "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"],
1166                         "plink" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "permalink or URL to a displayable copy of the message at its source"]
1167                 ],
1168                 "indexes" => [
1169                         "PRIMARY" => ["uri-id"],
1170                         "plink" => ["plink(191)"],
1171                         "resource-id" => ["resource-id"],
1172                         "title-content-warning-body" => ["FULLTEXT", "title", "content-warning", "body"],
1173                 ]
1174         ],
1175         "post-delivery" => [
1176                 "comment" => "Delivery data for posts for the batch processing",
1177                 "fields" => [
1178                         "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"],
1179                         "inbox-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Item-uri id of inbox url"],
1180                         "uid" => ["type" => "mediumint unsigned", "foreign" => ["user" => "uid"], "comment" => "Delivering user"],
1181                         "created" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
1182                         "command" => ["type" => "varbinary(32)", "comment" => ""],
1183                         "failed" => ["type" => "tinyint", "default" => 0, "comment" => "Number of times the delivery has failed"],
1184                         "receivers" => ["type" => "mediumtext", "comment" => "JSON encoded array with the receiving contacts"],
1185                 ],
1186                 "indexes" => [
1187                         "PRIMARY" => ["uri-id", "inbox-id"],
1188                         "inbox-id_created" => ["inbox-id", "created"],
1189                         "uid" => ["uid"],
1190                 ]
1191         ],
1192         "post-delivery-data" => [
1193                 "comment" => "Delivery data for items",
1194                 "fields" => [
1195                         "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"],
1196                         "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"],
1197                         "inform" => ["type" => "mediumtext", "comment" => "Additional receivers of the linked item"],
1198                         "queue_count" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Initial number of delivery recipients, used as item.delivery_queue_count"],
1199                         "queue_done" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries, used as item.delivery_queue_done"],
1200                         "queue_failed" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of unsuccessful deliveries, used as item.delivery_queue_failed"],
1201                         "activitypub" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via ActivityPub"],
1202                         "dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via DFRN"],
1203                         "legacy_dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via legacy DFRN"],
1204                         "diaspora" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via Diaspora"],
1205                         "ostatus" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via OStatus"],
1206                 ],
1207                 "indexes" => [
1208                         "PRIMARY" => ["uri-id"],
1209                 ]
1210         ],
1211         "post-history" => [
1212                 "comment" => "Post history",
1213                 "fields" => [
1214                         "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"],
1215                         "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "primary" => "1", "comment" => "Date of edit"],
1216                         "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "item title"],
1217                         "content-warning" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1218                         "body" => ["type" => "mediumtext", "comment" => "item body content"],
1219                         "raw-body" => ["type" => "mediumtext", "comment" => "Body without embedded media links"],
1220                         "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "text location where this item originated"],
1221                         "coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "longitude/latitude pair representing location where this item originated"],
1222                         "language" => ["type" => "text", "comment" => "Language information about this post"],
1223                         "app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "application which generated this item"],
1224                         "rendered-hash" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1225                         "rendered-html" => ["type" => "mediumtext", "comment" => "item.body converted to html"],
1226                         "object-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams object type"],
1227                         "object" => ["type" => "text", "comment" => "JSON encoded object structure unless it is an implied object (normal post)"],
1228                         "target-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams target type if applicable (URI)"],
1229                         "target" => ["type" => "text", "comment" => "JSON encoded target structure if used"],
1230                         "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"],
1231                         "plink" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "permalink or URL to a displayable copy of the message at its source"]
1232                 ],
1233                 "indexes" => [
1234                         "PRIMARY" => ["uri-id", "edited"],
1235                 ]
1236         ],
1237         "post-link" => [
1238                 "comment" => "Post related external links",
1239                 "fields" => [
1240                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1241                         "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"],
1242                         "url" => ["type" => "varbinary(511)", "not null" => "1", "comment" => "External URL"],
1243                         "mimetype" => ["type" => "varchar(60)", "comment" => ""],
1244                 ],
1245                 "indexes" => [
1246                         "PRIMARY" => ["id"],
1247                         "uri-id-url" => ["UNIQUE", "uri-id", "url"],
1248                 ]
1249         ],
1250         "post-media" => [
1251                 "comment" => "Attached media",
1252                 "fields" => [
1253                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1254                         "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"],
1255                         "url" => ["type" => "varbinary(511)", "not null" => "1", "comment" => "Media URL"],
1256                         "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Media type"],
1257                         "mimetype" => ["type" => "varchar(60)", "comment" => ""],
1258                         "height" => ["type" => "smallint unsigned", "comment" => "Height of the media"],
1259                         "width" => ["type" => "smallint unsigned", "comment" => "Width of the media"],
1260                         "size" => ["type" => "int unsigned", "comment" => "Media size"],
1261                         "preview" => ["type" => "varbinary(255)", "comment" => "Preview URL"],
1262                         "preview-height" => ["type" => "smallint unsigned", "comment" => "Height of the preview picture"],
1263                         "preview-width" => ["type" => "smallint unsigned", "comment" => "Width of the preview picture"],
1264                         "description" => ["type" => "text", "comment" => ""],
1265                         "name" => ["type" => "varchar(255)", "comment" => "Name of the media"],
1266                         "author-url" => ["type" => "varbinary(255)", "comment" => "URL of the author of the media"],
1267                         "author-name" => ["type" => "varchar(255)", "comment" => "Name of the author of the media"],
1268                         "author-image" => ["type" => "varbinary(255)", "comment" => "Image of the author of the media"],
1269                         "publisher-url" => ["type" => "varbinary(255)", "comment" => "URL of the publisher of the media"],
1270                         "publisher-name" => ["type" => "varchar(255)", "comment" => "Name of the publisher of the media"],
1271                         "publisher-image" => ["type" => "varbinary(255)", "comment" => "Image of the publisher of the media"],
1272                 ],
1273                 "indexes" => [
1274                         "PRIMARY" => ["id"],
1275                         "uri-id-url" => ["UNIQUE", "uri-id", "url"],
1276                         "uri-id-id" => ["uri-id", "id"],
1277                 ]
1278         ],
1279         "post-question" => [
1280                 "comment" => "Question",
1281                 "fields" => [
1282                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1283                         "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"],
1284                         "multiple" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Multiple choice"],
1285                         "voters" => ["type" => "int unsigned", "comment" => "Number of voters for this question"],
1286                         "end-time" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Question end time"],
1287                 ],
1288                 "indexes" => [
1289                         "PRIMARY" => ["id"],
1290                         "uri-id" => ["UNIQUE", "uri-id"],
1291                 ]
1292         ],
1293         "post-question-option" => [
1294                 "comment" => "Question option",
1295                 "fields" => [
1296                         "id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "comment" => "Id of the question"],
1297                         "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"],
1298                         "name" => ["type" => "varchar(255)", "comment" => "Name of the option"],
1299                         "replies" => ["type" => "int unsigned", "comment" => "Number of replies for this question option"],
1300                 ],
1301                 "indexes" => [
1302                         "PRIMARY" => ["uri-id", "id"],
1303                 ]
1304         ],
1305         "post-tag" => [
1306                 "comment" => "post relation to tags",
1307                 "fields" => [
1308                         "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"],
1309                         "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "comment" => ""],
1310                         "tid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["tag" => "id", "on delete" => "restrict"], "comment" => ""],
1311                         "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"],
1312                 ],
1313                 "indexes" => [
1314                         "PRIMARY" => ["uri-id", "type", "tid", "cid"],
1315                         "tid" => ["tid"],
1316                         "cid" => ["cid"]
1317                 ]
1318         ],
1319         "post-thread" => [
1320                 "comment" => "Thread related data",
1321                 "fields" => [
1322                         "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"],
1323                         "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Item owner"],
1324                         "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Item author"],
1325                         "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"],
1326                         "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
1327                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1328                         "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1329                         "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"],
1330                         "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
1331                 ],
1332                 "indexes" => [
1333                         "PRIMARY" => ["uri-id"],
1334                         "owner-id" => ["owner-id"],
1335                         "author-id" => ["author-id"],
1336                         "causer-id" => ["causer-id"],
1337                         "received" => ["received"],
1338                         "commented" => ["commented"],
1339                 ]
1340         ],
1341         "post-user" => [
1342                 "comment" => "User specific post data",
1343                 "fields" => [
1344                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
1345                         "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"],
1346                         "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the parent uri"],
1347                         "thr-parent-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"],
1348                         "external-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the external uri"],
1349                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation timestamp."],
1350                         "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last edit (default is created)"],
1351                         "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime"],
1352                         "gravity" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1353                         "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network from where the item comes from"],
1354                         "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"],
1355                         "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"],
1356                         "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"],
1357                         "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, image, article, ...)"],
1358                         "post-reason" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Reason why the post arrived at the user"],
1359                         "vid" => ["type" => "smallint unsigned", "foreign" => ["verb" => "id", "on delete" => "restrict"], "comment" => "Id of the verb table entry that contains the activity verbs"],
1360                         "private" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "0=public, 1=private, 2=unlisted"],
1361                         "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1362                         "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1363                         "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been marked for deletion"],
1364                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
1365                         "protocol" => ["type" => "tinyint unsigned", "comment" => "Protocol used to deliver the item for this user"],
1366                         "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact.id"],
1367                         "event-id" => ["type" => "int unsigned", "foreign" => ["event" => "id"], "comment" => "Used to link to the event.id"],
1368                         "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "post has not been seen"],
1369                         "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide the post from the user"],
1370                         "notification-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1371                         "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "This item was posted to the wall of uid"],
1372                         "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item originated at this site"],
1373                         "psid" => ["type" => "int unsigned", "foreign" => ["permissionset" => "id", "on delete" => "restrict"], "comment" => "ID of the permission set of this post"],
1374                 ],
1375                 "indexes" => [
1376                         "PRIMARY" => ["id"],
1377                         "uid_uri-id" => ["UNIQUE", "uid", "uri-id"],
1378                         "uri-id" => ["uri-id"],
1379                         "parent-uri-id" => ["parent-uri-id"],
1380                         "thr-parent-id" => ["thr-parent-id"],
1381                         "external-id" => ["external-id"],
1382                         "owner-id" => ["owner-id"],
1383                         "author-id" => ["author-id"],
1384                         "causer-id" => ["causer-id"],
1385                         "vid" => ["vid"],
1386                         "contact-id" => ["contact-id"],
1387                         "event-id" => ["event-id"],
1388                         "psid" => ["psid"],
1389                         "author-id_uid" => ["author-id", "uid"],
1390                         "author-id_received" => ["author-id", "received"],
1391                         "parent-uri-id_uid" => ["parent-uri-id", "uid"],
1392                         "uid_contactid" => ["uid", "contact-id"],
1393                         "uid_unseen_contactid" => ["uid", "unseen", "contact-id"],
1394                         "uid_unseen" => ["uid", "unseen"],
1395                         "uid_hidden_uri-id" => ["uid", "hidden", "uri-id"],
1396                 ],
1397         ],
1398         "post-thread-user" => [
1399                 "comment" => "Thread related data per user",
1400                 "fields" => [
1401                         "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"],
1402                         "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Item owner"],
1403                         "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Item author"],
1404                         "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"],
1405                         "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
1406                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1407                         "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1408                         "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"],
1409                         "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1410                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
1411                         "pinned" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "deprecated"],
1412                         "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1413                         "ignored" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Ignore updates for this thread"],
1414                         "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "This item was posted to the wall of uid"],
1415                         "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1416                         "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1417                         "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Deprecated"],
1418                         "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => "contact.id"],
1419                         "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "post has not been seen"],
1420                         "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide the post from the user"],
1421                         "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item originated at this site"],
1422                         "psid" => ["type" => "int unsigned", "foreign" => ["permissionset" => "id", "on delete" => "restrict"], "comment" => "ID of the permission set of this post"],
1423                         "post-user-id" => ["type" => "int unsigned", "foreign" => ["post-user" => "id"], "comment" => "Id of the post-user table"],
1424                 ],
1425                 "indexes" => [
1426                         "PRIMARY" => ["uid", "uri-id"],
1427                         "uri-id" => ["uri-id"],
1428                         "owner-id" => ["owner-id"],
1429                         "author-id" => ["author-id"],
1430                         "causer-id" => ["causer-id"],
1431                         "uid" => ["uid"],
1432                         "contact-id" => ["contact-id"],
1433                         "psid" => ["psid"],
1434                         "post-user-id" => ["post-user-id"],
1435                         "commented" => ["commented"],
1436                         "uid_received" => ["uid", "received"],
1437                         "uid_wall_received" => ["uid", "wall", "received"],
1438                         "uid_commented" => ["uid", "commented"],
1439                         "uid_starred" => ["uid", "starred"],
1440                         "uid_mention" => ["uid", "mention"],
1441                 ]
1442         ],
1443         "post-user-notification" => [
1444                 "comment" => "User post notifications",
1445                 "fields" => [
1446                         "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"],
1447                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
1448                         "notification-type" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1449                 ],
1450                 "indexes" => [
1451                         "PRIMARY" => ["uid", "uri-id"],
1452                         "uri-id" => ["uri-id"],
1453                 ],
1454         ],
1455         "process" => [
1456                 "comment" => "Currently running system processes",
1457                 "fields" => [
1458                         "pid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "comment" => "The ID of the process"],
1459                         "hostname" => ["type" => "varchar(32)", "not null" => "1", "primary" => "1", "comment" => "The name of the host the process is ran on"],
1460                         "command" => ["type" => "varbinary(32)", "not null" => "1", "default" => "", "comment" => ""],
1461                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1462                 ],
1463                 "indexes" => [
1464                         "PRIMARY" => ["pid", "hostname"],
1465                         "command" => ["command"],
1466                 ]
1467         ],
1468         "profile" => [
1469                 "comment" => "user profiles data",
1470                 "fields" => [
1471                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1472                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
1473                         "profile-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1474                         "is-default" => ["type" => "boolean", "comment" => "Deprecated"],
1475                         "hide-friends" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide friend list from viewers of this profile"],
1476                         "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1477                         "pdesc" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1478                         "dob" => ["type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00", "comment" => "Day of birth"],
1479                         "address" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1480                         "locality" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1481                         "region" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1482                         "postal-code" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1483                         "country-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1484                         "hometown" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1485                         "gender" => ["type" => "varchar(32)", "comment" => "Deprecated"],
1486                         "marital" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1487                         "with" => ["type" => "text", "comment" => "Deprecated"],
1488                         "howlong" => ["type" => "datetime", "comment" => "Deprecated"],
1489                         "sexual" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1490                         "politic" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1491                         "religion" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1492                         "pub_keywords" => ["type" => "text", "comment" => ""],
1493                         "prv_keywords" => ["type" => "text", "comment" => ""],
1494                         "likes" => ["type" => "text", "comment" => "Deprecated"],
1495                         "dislikes" => ["type" => "text", "comment" => "Deprecated"],
1496                         "about" => ["type" => "text", "comment" => "Profile description"],
1497                         "summary" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1498                         "music" => ["type" => "text", "comment" => "Deprecated"],
1499                         "book" => ["type" => "text", "comment" => "Deprecated"],
1500                         "tv" => ["type" => "text", "comment" => "Deprecated"],
1501                         "film" => ["type" => "text", "comment" => "Deprecated"],
1502                         "interest" => ["type" => "text", "comment" => "Deprecated"],
1503                         "romance" => ["type" => "text", "comment" => "Deprecated"],
1504                         "work" => ["type" => "text", "comment" => "Deprecated"],
1505                         "education" => ["type" => "text", "comment" => "Deprecated"],
1506                         "contact" => ["type" => "text", "comment" => "Deprecated"],
1507                         "homepage" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1508                         "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "XMPP address"],
1509                         "matrix" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Matrix address"],
1510                         "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1511                         "thumb" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1512                         "publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish default profile in local directory"],
1513                         "net-publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish profile in global directory"],
1514                 ],
1515                 "indexes" => [
1516                         "PRIMARY" => ["id"],
1517                         "uid_is-default" => ["uid", "is-default"],
1518                         "pub_keywords" => ["FULLTEXT", "pub_keywords"],
1519                 ]
1520         ],
1521         "profile_field" => [
1522                 "comment" => "Custom profile fields",
1523                 "fields" => [
1524                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1525                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "Owner user id"],
1526                         "order" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "1", "comment" => "Field ordering per user"],
1527                         "psid" => ["type" => "int unsigned", "foreign" => ["permissionset" => "id", "on delete" => "restrict"], "comment" => "ID of the permission set of this profile field - 0 = public"],
1528                         "label" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Label of the field"],
1529                         "value" => ["type" => "text", "comment" => "Value of the field"],
1530                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
1531                         "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
1532                 ],
1533                 "indexes" => [
1534                         "PRIMARY" => ["id"],
1535                         "uid" => ["uid"],
1536                         "order" => ["order"],
1537                         "psid" => ["psid"],
1538                 ]
1539         ],
1540         "push_subscriber" => [
1541                 "comment" => "Used for OStatus: Contains feed subscribers",
1542                 "fields" => [
1543                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1544                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1545                         "callback_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1546                         "topic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1547                         "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1548                         "push" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1549                         "last_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last successful trial"],
1550                         "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1551                         "renewed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last subscription renewal"],
1552                         "secret" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1553                 ],
1554                 "indexes" => [
1555                         "PRIMARY" => ["id"],
1556                         "next_try" => ["next_try"],
1557                         "uid" => ["uid"]
1558                 ]
1559         ],
1560         "register" => [
1561                 "comment" => "registrations requiring admin approval",
1562                 "fields" => [
1563                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1564                         "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1565                         "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1566                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1567                         "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1568                         "language" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
1569                         "note" => ["type" => "text", "comment" => ""],
1570                 ],
1571                 "indexes" => [
1572                         "PRIMARY" => ["id"],
1573                         "uid" => ["uid"],
1574                 ]
1575         ],
1576         "search" => [
1577                 "comment" => "",
1578                 "fields" => [
1579                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1580                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "foreign" => ["user" => "uid"], "comment" => "User id"],
1581                         "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1582                 ],
1583                 "indexes" => [
1584                         "PRIMARY" => ["id"],
1585                         "uid_term" => ["uid", "term(64)"],
1586                         "term" => ["term(64)"]
1587                 ]
1588         ],
1589         "session" => [
1590                 "comment" => "web session storage",
1591                 "fields" => [
1592                         "id" => ["type" => "bigint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1593                         "sid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
1594                         "data" => ["type" => "text", "comment" => ""],
1595                         "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1596                 ],
1597                 "indexes" => [
1598                         "PRIMARY" => ["id"],
1599                         "sid" => ["sid(64)"],
1600                         "expire" => ["expire"],
1601                 ]
1602         ],
1603         "storage" => [
1604                 "comment" => "Data stored by Database storage backend",
1605                 "fields" => [
1606                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented image data id"],
1607                         "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"]
1608                 ],
1609                 "indexes" => [
1610                         "PRIMARY" => ["id"]
1611                 ]
1612         ],
1613         "subscription" => [
1614                 "comment" => "Push Subscription for the API",
1615                 "fields" => [
1616                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented image data id"],
1617                         "application-id" => ["type" => "int unsigned", "not null" => "1", "foreign" => ["application" => "id"], "comment" => ""],
1618                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "foreign" => ["user" => "uid"], "comment" => "Owner User id"],
1619                         "endpoint" => ["type" => "varchar(511)", "comment" => "Endpoint URL"],
1620                         "pubkey" => ["type" => "varchar(127)", "comment" => "User agent public key"],
1621                         "secret" => ["type" => "varchar(32)", "comment" => "Auth secret"],
1622                         "follow" => ["type" => "boolean", "comment" => ""],
1623                         "favourite" => ["type" => "boolean", "comment" => ""],
1624                         "reblog" => ["type" => "boolean", "comment" => ""],
1625                         "mention" => ["type" => "boolean", "comment" => ""],
1626                         "poll" => ["type" => "boolean", "comment" => ""],
1627                         "follow_request" => ["type" => "boolean", "comment" => ""],
1628                         "status" => ["type" => "boolean", "comment" => ""],
1629                 ],
1630                 "indexes" => [
1631                         "PRIMARY" => ["id"],
1632                         "application-id_uid" => ["UNIQUE", "application-id", "uid"],
1633                         "uid_application-id" => ["uid", "application-id"],
1634                 ]
1635         ],
1636         "userd" => [
1637                 "comment" => "Deleted usernames",
1638                 "fields" => [
1639                         "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1640                         "username" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
1641                 ],
1642                 "indexes" => [
1643                         "PRIMARY" => ["id"],
1644                         "username" => ["username(32)"],
1645                 ]
1646         ],
1647         "user-contact" => [
1648                 "comment" => "User specific public contact data",
1649                 "fields" => [
1650                         "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["contact" => "id"], "comment" => "Contact id of the linked public contact"],
1651                         "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["user" => "uid"], "comment" => "User id"],
1652                         "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the contact url"],
1653                         "blocked" => ["type" => "boolean", "comment" => "Contact is completely blocked for this user"],
1654                         "ignored" => ["type" => "boolean", "comment" => "Posts from this contact are ignored"],
1655                         "collapsed" => ["type" => "boolean", "comment" => "Posts from this contact are collapsed"],
1656                         "hidden" => ["type" => "boolean", "comment" => "This contact is hidden from the others"],
1657                         "is-blocked" => ["type" => "boolean", "comment" => "User is blocked by this contact"],
1658                         "pending" => ["type" => "boolean", "comment" => ""],
1659                         "rel" => ["type" => "tinyint unsigned", "comment" => "The kind of the relation between the user and the contact"],
1660                         "info" => ["type" => "mediumtext", "comment" => ""],
1661                         "notify_new_posts" => ["type" => "boolean", "comment" => ""],
1662                         "remote_self" => ["type" => "boolean", "comment" => ""],
1663                         "fetch_further_information" => ["type" => "tinyint unsigned", "comment" => ""],
1664                         "ffi_keyword_denylist" => ["type" => "text", "comment" => ""],
1665                         "subhub" => ["type" => "boolean", "comment" => ""],
1666                         "hub-verify" => ["type" => "varchar(255)", "comment" => ""],
1667                         "protocol" => ["type" => "char(4)", "comment" => "Protocol of the contact"],
1668                         "rating" => ["type" => "tinyint", "comment" => "Automatically detected feed poll frequency"],
1669                         "priority" => ["type" => "tinyint unsigned", "comment" => "Feed poll priority"],
1670                 ],
1671                 "indexes" => [
1672                         "PRIMARY" => ["uid", "cid"],
1673                         "cid" => ["cid"],
1674                         "uri-id_uid" => ["UNIQUE", "uri-id", "uid"],
1675                 ]
1676         ],
1677         "worker-ipc" => [
1678                 "comment" => "Inter process communication between the frontend and the worker",
1679                 "fields" => [
1680                         "key" => ["type" => "int", "not null" => "1", "primary" => "1", "comment" => ""],
1681                         "jobs" => ["type" => "boolean", "comment" => "Flag for outstanding jobs"],
1682                 ],
1683                 "indexes" => [
1684                         "PRIMARY" => ["key"],
1685                 ],
1686                 "engine" => "MEMORY",
1687         ],
1688 ];