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