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