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