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