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