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