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