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