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