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