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