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