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