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