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