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