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