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