3 * @copyright Copyright (C) 2020, Friendica
5 * @license GNU AGPL version 3 or any later version
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.
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.
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/>.
20 * Main database structure configuration file.
22 * Here are described all the tables, fields and indexes Friendica needs to work.
24 * Syntax (braces indicate optionale values):
26 * "comment" => "Description of the table",
29 * "type" => "<field type>{(<field size>)} <unsigned>",
31 * {"extra" => "auto_increment",}
32 * {"default" => "<default value>",}
33 * {"default" => NULL_DATE,} (for datetime fields)
35 * {"foreign|relation" => ["<foreign key table name>" => "<foreign key field name>"],}
36 * "comment" => "Description of the fields"
41 * "PRIMARY" => ["<primary key field name>", ...],
42 * "<index name>" => [{"UNIQUE",} "<field name>{(<key size>)}", ...]
47 * Whenever possible prefer "foreign" before "relation" with the foreign keys.
48 * "foreign" adds true foreign keys on the database level, while "relation" simulates this behaviour.
50 * If you need to make any change, make sure to increment the DB_UPDATE_VERSION constant value below.
54 use Friendica\Database\DBA;
56 if (!defined('DB_UPDATE_VERSION')) {
57 define('DB_UPDATE_VERSION', 1356);
63 "comment" => "Global servers",
65 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
66 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
67 "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
68 "version" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
69 "site_name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
70 "info" => ["type" => "text", "comment" => ""],
71 "register_policy" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
72 "registered-users" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Number of registered users"],
73 "directory-type" => ["type" => "tinyint", "default" => "0", "comment" => "Type of directory service (Poco, Mastodon)"],
74 "poco" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
75 "noscrape" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
76 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
77 "platform" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
78 "relay-subscribe" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Has the server subscribed to the relay system"],
79 "relay-scope" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => "The scope of messages that the server wants to get"],
80 "detection-method" => ["type" => "tinyint unsigned", "comment" => "Method that had been used to detect that server"],
81 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
82 "last_poco_query" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
83 "last_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
84 "last_failure" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
88 "nurl" => ["UNIQUE", "nurl(190)"],
92 "comment" => "OAuth usage",
94 "client_id" => ["type" => "varchar(20)", "not null" => "1", "primary" => "1", "comment" => ""],
95 "pw" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => ""],
96 "redirect_uri" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
97 "name" => ["type" => "text", "comment" => ""],
98 "icon" => ["type" => "text", "comment" => ""],
99 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
102 "PRIMARY" => ["client_id"],
106 "comment" => "contact table",
108 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
109 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
110 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
111 "updated" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Date of last contact update"],
112 "self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if the contact is the user him/her self"],
113 "remote_self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
114 "rel" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "The kind of the relation between the user and the contact"],
115 "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
116 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network of the contact"],
117 "protocol" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Protocol of the contact"],
118 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"],
119 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"],
120 "location" => ["type" => "varchar(255)", "default" => "", "comment" => ""],
121 "about" => ["type" => "text", "comment" => ""],
122 "keywords" => ["type" => "text", "comment" => "public keywords (interests) of the contact"],
123 "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Deprecated"],
124 "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
125 "attag" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
126 "avatar" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
127 "photo" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo of the contact"],
128 "thumb" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (thumb size)"],
129 "micro" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (micro size)"],
130 "site-pubkey" => ["type" => "text", "comment" => ""],
131 "issued-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
132 "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
133 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
134 "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
135 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
136 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
137 "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
138 "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
139 "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
140 "request" => ["type" => "varchar(255)", "comment" => ""],
141 "notify" => ["type" => "varchar(255)", "comment" => ""],
142 "poll" => ["type" => "varchar(255)", "comment" => ""],
143 "confirm" => ["type" => "varchar(255)", "comment" => ""],
144 "subscribe" => ["type" => "varchar(255)", "comment" => ""],
145 "poco" => ["type" => "varchar(255)", "comment" => ""],
146 "aes_allow" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
147 "ret-aes" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
148 "usehub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
149 "subhub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
150 "hub-verify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
151 "last-update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last try to update the contact info"],
152 "success_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful contact update"],
153 "failure_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed update"],
154 "name-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
155 "uri-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
156 "avatar-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
157 "term-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
158 "last-item" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "date of the last post"],
159 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
160 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "Node-wide block status"],
161 "block_reason" => ["type" => "text", "comment" => "Node-wide block reason"],
162 "readonly" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "posts of the contact are readonly"],
163 "writable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
164 "forum" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a forum"],
165 "prv" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a private group"],
166 "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
167 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
168 "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
169 "pending" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
170 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact has been deleted"],
171 "rating" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
172 "unsearchable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact prefers to not be searchable"],
173 "sensitive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact posts sensitive content"],
174 "baseurl" => ["type" => "varchar(255)", "default" => "", "comment" => "baseurl of the contact"],
175 "gsid" => ["type" => "int unsigned", "foreign" => ["gserver" => "id", "on delete" => "restrict"], "comment" => "Global Server ID"],
176 "reason" => ["type" => "text", "comment" => ""],
177 "closeness" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "99", "comment" => ""],
178 "info" => ["type" => "mediumtext", "comment" => ""],
179 "profile-id" => ["type" => "int unsigned", "comment" => "Deprecated"],
180 "bdyear" => ["type" => "varchar(4)", "not null" => "1", "default" => "", "comment" => ""],
181 "bd" => ["type" => "date", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""],
182 "notify_new_posts" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
183 "fetch_further_information" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
184 "ffi_keyword_denylist" => ["type" => "text", "comment" => ""],
188 "uid_name" => ["uid", "name(190)"],
189 "self_uid" => ["self", "uid"],
190 "alias_uid" => ["alias(32)", "uid"],
191 "pending_uid" => ["pending", "uid"],
192 "blocked_uid" => ["blocked", "uid"],
193 "uid_rel_network_poll" => ["uid", "rel", "network", "poll(64)", "archive"],
194 "uid_network_batch" => ["uid", "network", "batch(64)"],
195 "addr_uid" => ["addr(32)", "uid"],
196 "nurl_uid" => ["nurl(32)", "uid"],
197 "nick_uid" => ["nick(32)", "uid"],
198 "attag_uid" => ["attag(32)", "uid"],
199 "dfrn-id" => ["dfrn-id(64)"],
200 "issued-id" => ["issued-id(64)"],
201 "network_uid_lastupdate" => ["network", "uid", "last-update"],
206 "comment" => "URI and GUID for items",
208 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
209 "uri" => ["type" => "varbinary(255)", "not null" => "1", "comment" => "URI of an item"],
210 "guid" => ["type" => "varbinary(255)", "comment" => "A unique identifier for an item"]
214 "uri" => ["UNIQUE", "uri"],
221 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
222 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner id of this permission set"],
223 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
224 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
225 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
226 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
230 "uid_allow_cid_allow_gid_deny_cid_deny_gid" => ["allow_cid(50)", "allow_gid(30)", "deny_cid(50)", "deny_gid(30)"],
234 "comment" => "tags and mentions",
236 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
237 "name" => ["type" => "varchar(96)", "not null" => "1", "default" => "", "comment" => ""],
238 "url" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""]
242 "type_name_url" => ["UNIQUE", "name", "url"],
247 "2fa_app_specific_password" => [
248 "comment" => "Two-factor app-specific _password",
250 "id" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Password ID for revocation"],
251 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "relation" => ["user" => "uid"], "comment" => "User ID"],
252 "description" => ["type" => "varchar(255)", "comment" => "Description of the usage of the password"],
253 "hashed_password" => ["type" => "varchar(255)", "not null" => "1", "comment" => "Hashed password"],
254 "generated" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the password was generated"],
255 "last_used" => ["type" => "datetime", "comment" => "Datetime the password was last used"],
259 "uid_description" => ["uid", "description(190)"],
262 "2fa_recovery_codes" => [
263 "comment" => "Two-factor authentication recovery codes",
265 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User ID"],
266 "code" => ["type" => "varchar(50)", "not null" => "1", "primary" => "1", "comment" => "Recovery code string"],
267 "generated" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the code was generated"],
268 "used" => ["type" => "datetime", "comment" => "Datetime the code was used"],
271 "PRIMARY" => ["uid", "code"]
275 "comment" => "registered addons",
277 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
278 "name" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "addon base (file)name"],
279 "version" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "currently unused"],
280 "installed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently always 1"],
281 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently unused"],
282 "timestamp" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "file timestamp to check for reloads"],
283 "plugin_admin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = has admin config, 0 = has no admin config"],
287 "name" => ["UNIQUE", "name"],
291 "comment" => "ActivityPub compatible contacts - used in the ActivityPub implementation",
293 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URL of the contact"],
294 "uuid" => ["type" => "varchar(255)", "comment" => ""],
295 "type" => ["type" => "varchar(20)", "not null" => "1", "comment" => ""],
296 "following" => ["type" => "varchar(255)", "comment" => ""],
297 "followers" => ["type" => "varchar(255)", "comment" => ""],
298 "inbox" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
299 "outbox" => ["type" => "varchar(255)", "comment" => ""],
300 "sharedinbox" => ["type" => "varchar(255)", "comment" => ""],
301 "manually-approve" => ["type" => "boolean", "comment" => ""],
302 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
303 "name" => ["type" => "varchar(255)", "comment" => ""],
304 "about" => ["type" => "text", "comment" => ""],
305 "photo" => ["type" => "varchar(255)", "comment" => ""],
306 "addr" => ["type" => "varchar(255)", "comment" => ""],
307 "alias" => ["type" => "varchar(255)", "comment" => ""],
308 "pubkey" => ["type" => "text", "comment" => ""],
309 "subscribe" => ["type" => "varchar(255)", "comment" => ""],
310 "baseurl" => ["type" => "varchar(255)", "comment" => "baseurl of the ap contact"],
311 "gsid" => ["type" => "int unsigned", "foreign" => ["gserver" => "id", "on delete" => "restrict"], "comment" => "Global Server ID"],
312 "generator" => ["type" => "varchar(255)", "comment" => "Name of the contact's system"],
313 "following_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of following contacts"],
314 "followers_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of followers"],
315 "statuses_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of posts"],
316 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
319 "PRIMARY" => ["url"],
320 "addr" => ["addr(32)"],
321 "alias" => ["alias(190)"],
322 "followers" => ["followers(190)"],
323 "baseurl" => ["baseurl(190)"],
328 "comment" => "file attachments",
330 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "generated index"],
331 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
332 "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "hash"],
333 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "filename of original"],
334 "filetype" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "mimetype"],
335 "filesize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "size in bytes"],
336 "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"],
337 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
338 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
339 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>"],
340 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
341 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
342 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
343 "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
344 "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"],
351 "comment" => "OAuth usage",
353 "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""],
354 "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "foreign" => ["clients" => "client_id"],
356 "redirect_uri" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
357 "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
358 "scope" => ["type" => "varchar(250)", "not null" => "1", "default" => "", "comment" => ""],
362 "client_id" => ["client_id"]
366 "comment" => "Stores temporary data",
368 "k" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "cache key"],
369 "v" => ["type" => "mediumtext", "comment" => "cached serialized value"],
370 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
371 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache insertion"],
375 "k_expires" => ["k", "expires"],
381 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
382 "challenge" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
383 "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
384 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
385 "type" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
386 "last_update" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
393 "comment" => "main configuration storage",
395 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
396 "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
397 "k" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
398 "v" => ["type" => "mediumtext", "comment" => ""],
402 "cat_k" => ["UNIQUE", "cat", "k"],
405 "contact-relation" => [
406 "comment" => "Contact relations",
408 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "primary" => "1", "comment" => "contact the related contact had interacted with"],
409 "relation-cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "primary" => "1", "comment" => "related contact who had interacted with the contact"],
410 "last-interaction" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last interaction"],
413 "PRIMARY" => ["cid", "relation-cid"],
414 "relation-cid" => ["relation-cid"],
418 "comment" => "private messages",
420 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
421 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this conversation"],
422 "recips" => ["type" => "text", "comment" => "sender_handle;recipient_handle"],
423 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
424 "creator" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "handle of creator"],
425 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation timestamp"],
426 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "edited timestamp"],
427 "subject" => ["type" => "text", "comment" => "subject of initial message"],
435 "comment" => "Raw data and structure information for messages",
437 "item-uri" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "Original URI of the item - unrelated to the table with the same name"],
438 "reply-to-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "URI to which this item is a reply"],
439 "conversation-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation URI"],
440 "conversation-href" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation link"],
441 "protocol" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "255", "comment" => "The protocol of the item"],
442 "direction" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "How the message arrived here: 1=push, 2=pull"],
443 "source" => ["type" => "mediumtext", "comment" => "Original source"],
444 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Receiving date"],
447 "PRIMARY" => ["item-uri"],
448 "conversation-uri" => ["conversation-uri"],
449 "received" => ["received"],
452 "diaspora-interaction" => [
453 "comment" => "Signed Diaspora Interaction",
455 "uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
456 "interaction" => ["type" => "mediumtext", "comment" => "The Diaspora interaction"]
459 "PRIMARY" => ["uri-id"]
463 "comment" => "Events",
465 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
466 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
467 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
468 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact_id (ID of the contact in contact table)"],
469 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
470 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
471 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
472 "start" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event start time"],
473 "finish" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event end time"],
474 "summary" => ["type" => "text", "comment" => "short description or title of the event"],
475 "desc" => ["type" => "text", "comment" => "event description"],
476 "location" => ["type" => "text", "comment" => "event location"],
477 "type" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => "event or birthday"],
478 "nofinish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if event does have no end this is 1"],
479 "adjust" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "adjust to timezone of the recipient (0 or 1)"],
480 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "0 or 1"],
481 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
482 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
483 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
484 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
488 "uid_start" => ["uid", "start"],
492 "comment" => "Diaspora compatible contacts - used in the Diaspora implementation",
494 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
495 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "unique id"],
496 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
497 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
498 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
499 "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
500 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
501 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
502 "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
503 "notify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
504 "poll" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
505 "confirm" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
506 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
507 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
508 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
509 "pubkey" => ["type" => "text", "comment" => ""],
510 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
514 "addr" => ["addr(32)"],
515 "url" => ["UNIQUE", "url(190)"],
519 "comment" => "friend suggestion stuff",
521 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
522 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
523 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
524 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
525 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
526 "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
527 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
528 "note" => ["type" => "text", "comment" => ""],
529 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
536 "comment" => "contacts ignored by friend suggestions",
538 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
539 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Local User id"],
540 "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => "gcontact.id of ignored contact"],
549 "comment" => "global contacts",
551 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
552 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"],
553 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"],
554 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the contacts profile page"],
555 "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
556 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the profile photo"],
557 "connect" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
558 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
559 "updated" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
560 "last_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
561 "last_failure" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
562 "last_discovery" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last contact discovery"],
563 "archive_date" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
564 "archived" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
565 "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
566 "about" => ["type" => "text", "comment" => ""],
567 "keywords" => ["type" => "text", "comment" => "puplic keywords (interests)"],
568 "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Deprecated"],
569 "birthday" => ["type" => "varchar(32)", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""],
570 "community" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if contact is forum account"],
571 "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "-1", "comment" => ""],
572 "hide" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = should be hidden from search"],
573 "nsfw" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = contact posts nsfw content"],
574 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "social network protocol"],
575 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
576 "notify" => ["type" => "varchar(255)", "comment" => ""],
577 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
578 "generation" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
579 "server_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "baseurl of the contacts server"],
580 "gsid" => ["type" => "int unsigned", "foreign" => ["gserver" => "id", "on delete" => "restrict"], "comment" => "Global Server ID"],
584 "nurl" => ["UNIQUE", "nurl(190)"],
585 "name" => ["name(64)"],
586 "nick" => ["nick(32)"],
587 "addr" => ["addr(64)"],
588 "hide_network_updated" => ["hide", "network", "updated"],
589 "updated" => ["updated"],
594 "comment" => "Followers of global contacts",
596 "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["gcontact" => "id"], "comment" => "global contact"],
597 "follower-gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["gcontact" => "id"], "comment" => "global contact of the follower"],
598 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates that the connection has been deleted"],
601 "PRIMARY" => ["gcid", "follower-gcid"],
602 "follower-gcid" => ["follower-gcid"],
606 "comment" => "'friends of friends' linkages derived from poco",
608 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
609 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
610 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
611 "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
612 "zcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
613 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
617 "cid_uid_gcid_zcid" => ["UNIQUE", "cid", "uid", "gcid", "zcid"],
622 "comment" => "privacy groups, group info",
624 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
625 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
626 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the member list is not private"],
627 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the group has been deleted"],
628 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "human readable name of group"],
636 "comment" => "privacy groups, member info",
638 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
639 "gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["group" => "id"], "comment" => "groups.id of the associated group"],
640 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id of the member assigned to the associated group"],
644 "contactid" => ["contact-id"],
645 "gid_contactid" => ["UNIQUE", "gid", "contact-id"],
649 "comment" => "Tags that the server has subscribed",
651 "gserver-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gserver" => "id"], "primary" => "1",
652 "comment" => "The id of the gserver"],
653 "tag" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "primary" => "1", "comment" => "Tag that the server has subscribed"],
656 "PRIMARY" => ["gserver-id", "tag"],
661 "comment" => "addon hook registry",
663 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
664 "hook" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => "name of hook"],
665 "file" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "relative filename of hook handler"],
666 "function" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "function name of hook handler"],
667 "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"],
671 "hook_file_function" => ["UNIQUE", "hook", "file", "function"],
675 "comment" => "Status of ActivityPub inboxes",
677 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URL of the inbox"],
678 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date of this entry"],
679 "success" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful delivery"],
680 "failure" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed delivery"],
681 "previous" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Previous delivery date"],
682 "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the inbox archived?"],
683 "shared" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is it a shared inbox?"]
692 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
693 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
694 "fid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["fcontact" => "id"], "comment" => ""],
695 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
696 "knowyou" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
697 "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
698 "note" => ["type" => "text", "comment" => ""],
699 "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
700 "datetime" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
701 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
702 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
709 "comment" => "Structure for all posts",
711 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
712 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this item"],
713 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
714 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
715 "uri-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
716 "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"],
717 "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "uri of the parent to this item"],
718 "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the parent uri"],
719 "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"],
720 "thr-parent-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"],
721 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation timestamp."],
722 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last edit (default is created)"],
723 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last comment/reply to this item"],
724 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime"],
725 "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"],
726 "gravity" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
727 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network from where the item comes from"],
728 "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"],
729 "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"],
730 "icid" => ["type" => "int unsigned", "relation" => ["item-content" => "id"], "comment" => "Id of the item-content table entry that contains the whole item content"],
731 "iaid" => ["type" => "int unsigned", "relation" => ["item-activity" => "id"], "comment" => "Id of the item-activity table entry that contains the activity data"],
732 "vid" => ["type" => "smallint unsigned", "relation" => ["verb" => "id"], "comment" => "Id of the verb table entry that contains the activity verbs"],
733 "extid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
734 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"],
735 "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
736 "private" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "0=public, 1=private, 2=unlisted"],
737 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
738 "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
739 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been deleted"],
740 // User specific fields. Eventually they will move to user-item
741 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
742 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
743 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "This item was posted to the wall of uid"],
744 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item originated at this site"],
745 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
746 "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been favourited"],
747 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "item has not been seen"],
748 "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "The owner of this item was mentioned in it"],
749 "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
750 "psid" => ["type" => "int unsigned", "foreign" => ["permissionset" => "id", "on delete" => "restrict"], "comment" => "ID of the permission set of this post"],
751 // It has to be decided whether these fields belong to the user or the structure
752 "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"],
753 "event-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["event" => "id"], "comment" => "Used to link to the event.id"],
754 // Could possibly be replaced by the "attach" table?
755 "attach" => ["type" => "mediumtext", "comment" => "JSON structure representing attachments to this item"],
756 // Deprecated fields. Will be removed in upcoming versions
757 "allow_cid" => ["type" => "mediumtext", "comment" => "Deprecated"],
758 "allow_gid" => ["type" => "mediumtext", "comment" => "Deprecated"],
759 "deny_cid" => ["type" => "mediumtext", "comment" => "Deprecated"],
760 "deny_gid" => ["type" => "mediumtext", "comment" => "Deprecated"],
761 "postopts" => ["type" => "text", "comment" => "Deprecated"],
762 "inform" => ["type" => "mediumtext", "comment" => "Deprecated"],
763 "type" => ["type" => "varchar(20)", "comment" => "Deprecated"],
764 "bookmark" => ["type" => "boolean", "comment" => "Deprecated"],
765 "file" => ["type" => "mediumtext", "comment" => "Deprecated"],
766 "location" => ["type" => "varchar(255)", "comment" => "Deprecated"],
767 "coord" => ["type" => "varchar(255)", "comment" => "Deprecated"],
768 "tag" => ["type" => "mediumtext", "comment" => "Deprecated"],
769 "plink" => ["type" => "varchar(255)", "comment" => "Deprecated"],
770 "title" => ["type" => "varchar(255)", "comment" => "Deprecated"],
771 "content-warning" => ["type" => "varchar(255)", "comment" => "Deprecated"],
772 "body" => ["type" => "mediumtext", "comment" => "Deprecated"],
773 "app" => ["type" => "varchar(255)", "comment" => "Deprecated"],
774 "verb" => ["type" => "varchar(100)", "comment" => "Deprecated"],
775 "object-type" => ["type" => "varchar(100)", "comment" => "Deprecated"],
776 "object" => ["type" => "text", "comment" => "Deprecated"],
777 "target-type" => ["type" => "varchar(100)", "comment" => "Deprecated"],
778 "target" => ["type" => "text", "comment" => "Deprecated"],
779 "author-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
780 "author-link" => ["type" => "varchar(255)", "comment" => "Deprecated"],
781 "author-avatar" => ["type" => "varchar(255)", "comment" => "Deprecated"],
782 "owner-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
783 "owner-link" => ["type" => "varchar(255)", "comment" => "Deprecated"],
784 "owner-avatar" => ["type" => "varchar(255)", "comment" => "Deprecated"],
785 "rendered-hash" => ["type" => "varchar(32)", "comment" => "Deprecated"],
786 "rendered-html" => ["type" => "mediumtext", "comment" => "Deprecated"],
790 "guid" => ["guid(191)"],
791 "uri" => ["uri(191)"],
792 "parent" => ["parent"],
793 "parent-uri" => ["parent-uri(191)"],
794 "extid" => ["extid(191)"],
795 "uid_id" => ["uid", "id"],
796 "uid_contactid_id" => ["uid", "contact-id", "id"],
797 "uid_received" => ["uid", "received"],
798 "uid_commented" => ["uid", "commented"],
799 "uid_unseen_contactid" => ["uid", "unseen", "contact-id"],
800 "uid_network_received" => ["uid", "network", "received"],
801 "uid_network_commented" => ["uid", "network", "commented"],
802 "uid_thrparent" => ["uid", "thr-parent(190)"],
803 "uid_parenturi" => ["uid", "parent-uri(190)"],
804 "uid_contactid_received" => ["uid", "contact-id", "received"],
805 "authorid_received" => ["author-id", "received"],
806 "ownerid" => ["owner-id"],
807 "contact-id" => ["contact-id"],
808 "uid_uri" => ["uid", "uri(190)"],
809 "resource-id" => ["resource-id"],
810 "deleted_changed" => ["deleted", "changed"],
811 "uid_wall_changed" => ["uid", "wall", "changed"],
812 "mention_uid_id" => ["mention", "uid", "id"],
813 "uid_eventid" => ["uid", "event-id"],
816 "psid_wall" => ["psid", "wall"],
817 "uri-id" => ["uri-id"],
818 "parent-uri-id" => ["parent-uri-id"],
819 "thr-parent-id" => ["thr-parent-id"],
823 "comment" => "Activities for items",
825 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
826 "uri" => ["type" => "varchar(255)", "comment" => ""],
827 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
828 "uri-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
829 "activity" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""]
833 "uri-hash" => ["UNIQUE", "uri-hash"],
834 "uri" => ["uri(191)"],
835 "uri-id" => ["uri-id"]
839 "comment" => "Content for all posts",
841 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
842 "uri" => ["type" => "varchar(255)", "comment" => ""],
843 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
844 "uri-plink-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
845 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "item title"],
846 "content-warning" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
847 "body" => ["type" => "mediumtext", "comment" => "item body content"],
848 "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "text location where this item originated"],
849 "coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "longitude/latitude pair representing location where this item originated"],
850 "language" => ["type" => "text", "comment" => "Language information about this post"],
851 "app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "application which generated this item"],
852 "rendered-hash" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
853 "rendered-html" => ["type" => "mediumtext", "comment" => "item.body converted to html"],
854 "object-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams object type"],
855 "object" => ["type" => "text", "comment" => "JSON encoded object structure unless it is an implied object (normal post)"],
856 "target-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams target type if applicable (URI)"],
857 "target" => ["type" => "text", "comment" => "JSON encoded target structure if used"],
858 "plink" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "permalink or URL to a displayable copy of the message at its source"],
859 "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams verb"]
863 "uri-plink-hash" => ["UNIQUE", "uri-plink-hash"],
864 "uri" => ["uri(191)"],
865 "plink" => ["plink(191)"],
866 "uri-id" => ["uri-id"]
872 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
873 "name" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => ""],
874 "locked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
875 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process ID"],
876 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
880 "name_expires" => ["name", "expires"]
884 "comment" => "private messages",
886 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
887 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
888 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this private message"],
889 "from-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "name of the sender"],
890 "from-photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "contact photo link of the sender"],
891 "from-url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "profile linke of the sender"],
892 "contact-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "relation" => ["contact" => "id"], "comment" => "contact.id"],
893 "convid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["conv" => "id"], "comment" => "conv.id"],
894 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
895 "body" => ["type" => "mediumtext", "comment" => ""],
896 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if message visited it is 1"],
897 "reply" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
898 "replied" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
899 "unknown" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if sender not in the contact table this is 1"],
900 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
901 "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
902 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time of the private message"],
906 "uid_seen" => ["uid", "seen"],
907 "convid" => ["convid"],
908 "uri" => ["uri(64)"],
909 "parent-uri" => ["parent-uri(64)"],
910 "contactid" => ["contact-id(32)"],
914 "comment" => "Mail account data for fetching mails",
916 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
917 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
918 "server" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
919 "port" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
920 "ssltype" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
921 "mailbox" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
922 "user" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
923 "pass" => ["type" => "text", "comment" => ""],
924 "reply_to" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
925 "action" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
926 "movetofolder" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
927 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
928 "last_check" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
935 "comment" => "table of accounts that can manage each other",
937 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
938 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
939 "mid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
943 "uid_mid" => ["UNIQUE", "uid", "mid"],
947 "comment" => "notifications",
949 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
950 "type" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
951 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
952 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
953 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
954 "date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
955 "msg" => ["type" => "mediumtext", "comment" => ""],
956 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
957 "link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
958 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id"],
959 "parent" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
960 "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Item-uri id of the related post"],
961 "parent-uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related post"],
962 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
963 "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""],
964 "otype" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => ""],
965 "name_cache" => ["type" => "tinytext", "comment" => "Cached bbcode parsing of name"],
966 "msg_cache" => ["type" => "mediumtext", "comment" => "Cached bbcode parsing of msg"]
970 "seen_uid_date" => ["seen", "uid", "date"],
971 "uid_date" => ["uid", "date"],
972 "uid_type_link" => ["uid", "type", "link(190)"],
975 "notify-threads" => [
978 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
979 "notify-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["notify" => "id"], "comment" => ""],
980 "master-parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
981 "master-parent-uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related post"],
982 "parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
983 "receiver-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"],
984 "comment" => "User id"],
988 "master-parent-uri-id" => ["master-parent-uri-id"],
992 "comment" => "cache for OEmbed queries",
994 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
995 "maxwidth" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "comment" => "Maximum width passed to Oembed"],
996 "content" => ["type" => "mediumtext", "comment" => "OEmbed data of the page"],
997 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
1000 "PRIMARY" => ["url", "maxwidth"],
1001 "created" => ["created"],
1004 "openwebauth-token" => [
1005 "comment" => "Store OpenWebAuth token to verify contacts",
1007 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1008 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1009 "type" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Verify type"],
1010 "token" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A generated token"],
1011 "meta" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1012 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
1015 "PRIMARY" => ["id"],
1019 "comment" => "cache for 'parse_url' queries",
1021 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
1022 "guessing" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the 'guessing' mode active?"],
1023 "oembed" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the data the result of oembed?"],
1024 "content" => ["type" => "mediumtext", "comment" => "page data"],
1025 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
1028 "PRIMARY" => ["url", "guessing", "oembed"],
1029 "created" => ["created"],
1032 "participation" => [
1033 "comment" => "Storage for participation messages from Diaspora",
1035 "iid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["item" => "id"], "comment" => ""],
1036 "server" => ["type" => "varchar(60)", "not null" => "1", "primary" => "1", "comment" => ""],
1037 "cid" => ["type" => "int unsigned", "not null" => "1", "relation" => ["contact" => "id"], "comment" => ""],
1038 "fid" => ["type" => "int unsigned", "not null" => "1", "relation" => ["fcontact" => "id"], "comment" => ""],
1041 "PRIMARY" => ["iid", "server"],
1047 "comment" => "personal (per user) configuration storage",
1049 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
1050 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1051 "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
1052 "k" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => ""],
1053 "v" => ["type" => "mediumtext", "comment" => ""],
1056 "PRIMARY" => ["id"],
1057 "uid_cat_k" => ["UNIQUE", "uid", "cat", "k"],
1061 "comment" => "photo storage",
1063 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1064 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
1065 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
1066 "guid" => ["type" => "char(16)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this photo"],
1067 "resource-id" => ["type" => "char(32)", "not null" => "1", "default" => "", "comment" => ""],
1068 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation date"],
1069 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edited date"],
1070 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1071 "desc" => ["type" => "text", "comment" => ""],
1072 "album" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "The name of the album to which the photo belongs"],
1073 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1074 "type" => ["type" => "varchar(30)", "not null" => "1", "default" => "image/jpeg"],
1075 "height" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1076 "width" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1077 "datasize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1078 "data" => ["type" => "mediumblob", "not null" => "1", "comment" => ""],
1079 "scale" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1080 "profile" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1081 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
1082 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
1083 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
1084 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
1085 "accessible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Make photo publicly accessible, ignoring permissions"],
1086 "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
1087 "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"],
1088 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
1091 "PRIMARY" => ["id"],
1092 "contactid" => ["contact-id"],
1093 "uid_contactid" => ["uid", "contact-id"],
1094 "uid_profile" => ["uid", "profile"],
1095 "uid_album_scale_created" => ["uid", "album(32)", "scale", "created"],
1096 "uid_album_resource-id_created" => ["uid", "album(32)", "resource-id", "created"],
1097 "resource-id" => ["resource-id"],
1101 "comment" => "Currently unused table for storing poll results",
1103 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
1104 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1105 "q0" => ["type" => "text", "comment" => ""],
1106 "q1" => ["type" => "text", "comment" => ""],
1107 "q2" => ["type" => "text", "comment" => ""],
1108 "q3" => ["type" => "text", "comment" => ""],
1109 "q4" => ["type" => "text", "comment" => ""],
1110 "q5" => ["type" => "text", "comment" => ""],
1111 "q6" => ["type" => "text", "comment" => ""],
1112 "q7" => ["type" => "text", "comment" => ""],
1113 "q8" => ["type" => "text", "comment" => ""],
1114 "q9" => ["type" => "text", "comment" => ""],
1117 "PRIMARY" => ["id"],
1122 "comment" => "data for polls - currently unused",
1124 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1125 "poll_id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["poll" => "id"]],
1126 "choice" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1129 "PRIMARY" => ["id"],
1130 "poll_id" => ["poll_id"],
1133 "post-category" => [
1134 "comment" => "post relation to categories",
1136 "uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
1137 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
1138 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "comment" => ""],
1139 "tid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["tag" => "id", "on delete" => "restrict"], "comment" => ""],
1142 "PRIMARY" => ["uri-id", "uid", "type", "tid"],
1146 "post-delivery-data" => [
1147 "comment" => "Delivery data for items",
1149 "uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
1150 "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"],
1151 "inform" => ["type" => "mediumtext", "comment" => "Additional receivers of the linked item"],
1152 "queue_count" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Initial number of delivery recipients, used as item.delivery_queue_count"],
1153 "queue_done" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries, used as item.delivery_queue_done"],
1154 "queue_failed" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of unsuccessful deliveries, used as item.delivery_queue_failed"],
1155 "activitypub" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via ActivityPub"],
1156 "dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via DFRN"],
1157 "legacy_dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via legacy DFRN"],
1158 "diaspora" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via Diaspora"],
1159 "ostatus" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via OStatus"],
1162 "PRIMARY" => ["uri-id"],
1166 "comment" => "post relation to tags",
1168 "uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
1169 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "comment" => ""],
1170 "tid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["tag" => "id", "on delete" => "restrict"], "comment" => ""],
1171 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Contact id of the mentioned public contact"],
1174 "PRIMARY" => ["uri-id", "type", "tid", "cid"],
1180 "comment" => "Currently running system processes",
1182 "pid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "comment" => ""],
1183 "command" => ["type" => "varbinary(32)", "not null" => "1", "default" => "", "comment" => ""],
1184 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1187 "PRIMARY" => ["pid"],
1188 "command" => ["command"],
1192 "comment" => "user profiles data",
1194 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1195 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
1196 "profile-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1197 "is-default" => ["type" => "boolean", "comment" => "Deprecated"],
1198 "hide-friends" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide friend list from viewers of this profile"],
1199 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1200 "pdesc" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1201 "dob" => ["type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00", "comment" => "Day of birth"],
1202 "address" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1203 "locality" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1204 "region" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1205 "postal-code" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1206 "country-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1207 "hometown" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1208 "gender" => ["type" => "varchar(32)", "comment" => "Deprecated"],
1209 "marital" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1210 "with" => ["type" => "text", "comment" => "Deprecated"],
1211 "howlong" => ["type" => "datetime", "comment" => "Deprecated"],
1212 "sexual" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1213 "politic" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1214 "religion" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1215 "pub_keywords" => ["type" => "text", "comment" => ""],
1216 "prv_keywords" => ["type" => "text", "comment" => ""],
1217 "likes" => ["type" => "text", "comment" => "Deprecated"],
1218 "dislikes" => ["type" => "text", "comment" => "Deprecated"],
1219 "about" => ["type" => "text", "comment" => "Profile description"],
1220 "summary" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1221 "music" => ["type" => "text", "comment" => "Deprecated"],
1222 "book" => ["type" => "text", "comment" => "Deprecated"],
1223 "tv" => ["type" => "text", "comment" => "Deprecated"],
1224 "film" => ["type" => "text", "comment" => "Deprecated"],
1225 "interest" => ["type" => "text", "comment" => "Deprecated"],
1226 "romance" => ["type" => "text", "comment" => "Deprecated"],
1227 "work" => ["type" => "text", "comment" => "Deprecated"],
1228 "education" => ["type" => "text", "comment" => "Deprecated"],
1229 "contact" => ["type" => "text", "comment" => "Deprecated"],
1230 "homepage" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1231 "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1232 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1233 "thumb" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1234 "publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish default profile in local directory"],
1235 "net-publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish profile in global directory"],
1238 "PRIMARY" => ["id"],
1239 "uid_is-default" => ["uid", "is-default"],
1240 "pub_keywords" => ["FULLTEXT", "pub_keywords"],
1243 "profile_check" => [
1244 "comment" => "DFRN remote auth use",
1246 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1247 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1248 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
1249 "dfrn_id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1250 "sec" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1251 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1254 "PRIMARY" => ["id"],
1257 "profile_field" => [
1258 "comment" => "Custom profile fields",
1260 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1261 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner user id"],
1262 "order" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "1", "comment" => "Field ordering per user"],
1263 "psid" => ["type" => "int unsigned", "foreign" => ["permissionset" => "id", "on delete" => "restrict"], "comment" => "ID of the permission set of this profile field - 0 = public"],
1264 "label" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Label of the field"],
1265 "value" => ["type" => "text", "comment" => "Value of the field"],
1266 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
1267 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
1270 "PRIMARY" => ["id"],
1272 "order" => ["order"],
1276 "push_subscriber" => [
1277 "comment" => "Used for OStatus: Contains feed subscribers",
1279 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1280 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1281 "callback_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1282 "topic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1283 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1284 "push" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1285 "last_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last successful trial"],
1286 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1287 "renewed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last subscription renewal"],
1288 "secret" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1291 "PRIMARY" => ["id"],
1292 "next_try" => ["next_try"],
1296 "comment" => "registrations requiring admin approval",
1298 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1299 "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1300 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1301 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1302 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1303 "language" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
1304 "note" => ["type" => "text", "comment" => ""],
1307 "PRIMARY" => ["id"],
1313 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1314 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1315 "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1318 "PRIMARY" => ["id"],
1323 "comment" => "web session storage",
1325 "id" => ["type" => "bigint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1326 "sid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
1327 "data" => ["type" => "text", "comment" => ""],
1328 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1331 "PRIMARY" => ["id"],
1332 "sid" => ["sid(64)"],
1333 "expire" => ["expire"],
1337 "comment" => "Data stored by Database storage backend",
1339 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented image data id"],
1340 "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"]
1347 "comment" => "Thread related data",
1349 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"],
1350 "comment" => "sequential ID"],
1351 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
1352 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1353 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
1354 "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item owner"],
1355 "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item author"],
1356 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1357 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1358 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1359 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1360 "changed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1361 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1362 "private" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "0=public, 1=private, 2=unlisted"],
1363 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1364 "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1365 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1366 "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1367 "ignored" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1368 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"],
1369 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
1370 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1371 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1372 "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1373 "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1374 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
1375 "bookmark" => ["type" => "boolean", "comment" => ""],
1378 "PRIMARY" => ["iid"],
1379 "uid_network_commented" => ["uid", "network", "commented"],
1380 "uid_network_received" => ["uid", "network", "received"],
1381 "uid_contactid_commented" => ["uid", "contact-id", "commented"],
1382 "uid_contactid_received" => ["uid", "contact-id", "received"],
1383 "contactid" => ["contact-id"],
1384 "ownerid" => ["owner-id"],
1385 "authorid" => ["author-id"],
1386 "uid_received" => ["uid", "received"],
1387 "uid_commented" => ["uid", "commented"],
1388 "uid_wall_received" => ["uid", "wall", "received"],
1389 "private_wall_origin_commented" => ["private", "wall", "origin", "commented"],
1390 "uri-id" => ["uri-id"],
1394 "comment" => "OAuth usage",
1396 "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""],
1397 "secret" => ["type" => "text", "comment" => ""],
1398 "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "foreign" => ["clients" => "client_id"]],
1399 "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
1400 "scope" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
1401 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1404 "PRIMARY" => ["id"],
1405 "client_id" => ["client_id"]
1409 "comment" => "The local users",
1411 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1412 "parent-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"],
1413 "comment" => "The parent user that has full control about this user"],
1414 "guid" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this user"],
1415 "username" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this user is known by"],
1416 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "encrypted password"],
1417 "legacy_password" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the password hash double-hashed?"],
1418 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "nick- and user name"],
1419 "email" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "the users email address"],
1420 "openid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1421 "timezone" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => "PHP-legal timezone"],
1422 "language" => ["type" => "varchar(32)", "not null" => "1", "default" => "en", "comment" => "default language"],
1423 "register_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of registration"],
1424 "login_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last login"],
1425 "default-location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Default for item.location"],
1426 "allow_location" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 allows to display the location"],
1427 "theme" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "user theme preference"],
1428 "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
1429 "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
1430 "spubkey" => ["type" => "text", "comment" => ""],
1431 "sprvkey" => ["type" => "text", "comment" => ""],
1432 "verified" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "user is verified through email"],
1433 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 for user is blocked"],
1434 "blockwall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to post to the profile page of the user"],
1435 "hidewall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide profile details from unkown viewers"],
1436 "blocktags" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to tag the post of this user"],
1437 "unkmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Permit unknown people to send private mails to this user"],
1438 "cntunkmail" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
1439 "notify-flags" => ["type" => "smallint unsigned", "not null" => "1", "default" => "65535", "comment" => "email notification options"],
1440 "page-flags" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "page/profile type"],
1441 "account-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1442 "prvnets" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1443 "pwdreset" => ["type" => "varchar(255)", "comment" => "Password reset request token"],
1444 "pwdreset_time" => ["type" => "datetime", "comment" => "Timestamp of the last password reset request"],
1445 "maxreq" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
1446 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1447 "account_removed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if 1 the account is removed"],
1448 "account_expired" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1449 "account_expires_on" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp when account expires and will be deleted"],
1450 "expire_notification_sent" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last warning of account expiration"],
1451 "def_gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1452 "allow_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1453 "allow_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1454 "deny_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1455 "deny_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1456 "openidserver" => ["type" => "text", "comment" => ""],
1459 "PRIMARY" => ["uid"],
1460 "nickname" => ["nickname(32)"],
1464 "comment" => "Deleted usernames",
1466 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1467 "username" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
1470 "PRIMARY" => ["id"],
1471 "username" => ["username(32)"],
1475 "comment" => "User specific public contact data",
1477 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["contact" => "id"], "comment" => "Contact id of the linked public contact"],
1478 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
1479 "blocked" => ["type" => "boolean", "comment" => "Contact is completely blocked for this user"],
1480 "ignored" => ["type" => "boolean", "comment" => "Posts from this contact are ignored"],
1481 "collapsed" => ["type" => "boolean", "comment" => "Posts from this contact are collapsed"]
1484 "PRIMARY" => ["uid", "cid"]
1488 "comment" => "User specific item data",
1490 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"], "comment" => "Item id"],
1491 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
1492 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide an item from the user"],
1493 "ignored" => ["type" => "boolean", "comment" => "Ignore this thread if set"],
1494 "pinned" => ["type" => "boolean", "comment" => "The item is pinned on the profile page"],
1495 "notification-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1498 "PRIMARY" => ["uid", "iid"],
1499 "uid_pinned" => ["uid", "pinned"],
1500 "iid_uid" => ["iid", "uid"]
1504 "comment" => "Activity Verbs",
1506 "id" => ["type" => "smallint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
1507 "name" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""]
1514 "comment" => "Inter process communication between the frontend and the worker",
1516 "key" => ["type" => "int", "not null" => "1", "primary" => "1", "comment" => ""],
1517 "jobs" => ["type" => "boolean", "comment" => "Flag for outstanding jobs"],
1520 "PRIMARY" => ["key"],
1522 "engine" => "MEMORY",
1525 "comment" => "Background tasks queue entries",
1527 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented worker task id"],
1528 "parameter" => ["type" => "mediumtext", "comment" => "Task command"],
1529 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Task priority"],
1530 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date"],
1531 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process id of the worker"],
1532 "executed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Execution date"],
1533 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1534 "retrial" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1535 "done" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marked 1 when the task was done - will be deleted later"],
1538 "PRIMARY" => ["id"],
1539 "done_parameter" => ["done", "parameter(64)"],
1540 "done_executed" => ["done", "executed"],
1541 "done_priority_created" => ["done", "priority", "created"],
1542 "done_priority_next_try" => ["done", "priority", "next_try"],
1543 "done_pid_next_try" => ["done", "pid", "next_try"],
1544 "done_pid_priority_created" => ["done", "pid", "priority", "created"]