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