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