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