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