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