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', 1350);
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 "poco" => ["type" => "varchar(255)", "comment" => ""],
145 "aes_allow" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
146 "ret-aes" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
147 "usehub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
148 "subhub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
149 "hub-verify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
150 "last-update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last try to update the contact info"],
151 "success_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful contact update"],
152 "failure_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed update"],
153 "name-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
154 "uri-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
155 "avatar-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
156 "term-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
157 "last-item" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "date of the last post"],
158 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
159 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "Node-wide block status"],
160 "block_reason" => ["type" => "text", "comment" => "Node-wide block reason"],
161 "readonly" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "posts of the contact are readonly"],
162 "writable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
163 "forum" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a forum"],
164 "prv" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a private group"],
165 "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
166 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
167 "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
168 "pending" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
169 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact has been deleted"],
170 "rating" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
171 "unsearchable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact prefers to not be searchable"],
172 "sensitive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact posts sensitive content"],
173 "baseurl" => ["type" => "varchar(255)", "default" => "", "comment" => "baseurl of the contact"],
174 "gsid" => ["type" => "int unsigned", "foreign" => ["gserver" => "id", "on delete" => "restrict"], "comment" => "Global Server ID"],
175 "reason" => ["type" => "text", "comment" => ""],
176 "closeness" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "99", "comment" => ""],
177 "info" => ["type" => "mediumtext", "comment" => ""],
178 "profile-id" => ["type" => "int unsigned", "comment" => "Deprecated"],
179 "bdyear" => ["type" => "varchar(4)", "not null" => "1", "default" => "", "comment" => ""],
180 "bd" => ["type" => "date", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""],
181 "notify_new_posts" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
182 "fetch_further_information" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
183 "ffi_keyword_blacklist" => ["type" => "text", "comment" => ""],
187 "uid_name" => ["uid", "name(190)"],
188 "self_uid" => ["self", "uid"],
189 "alias_uid" => ["alias(32)", "uid"],
190 "pending_uid" => ["pending", "uid"],
191 "blocked_uid" => ["blocked", "uid"],
192 "uid_rel_network_poll" => ["uid", "rel", "network", "poll(64)", "archive"],
193 "uid_network_batch" => ["uid", "network", "batch(64)"],
194 "addr_uid" => ["addr(32)", "uid"],
195 "nurl_uid" => ["nurl(32)", "uid"],
196 "nick_uid" => ["nick(32)", "uid"],
197 "dfrn-id" => ["dfrn-id(64)"],
198 "issued-id" => ["issued-id(64)"],
203 "comment" => "URI and GUID for items",
205 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
206 "uri" => ["type" => "varbinary(255)", "not null" => "1", "comment" => "URI of an item"],
207 "guid" => ["type" => "varbinary(255)", "comment" => "A unique identifier for an item"]
211 "uri" => ["UNIQUE", "uri"],
218 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
219 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner id of this permission set"],
220 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
221 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
222 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
223 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
227 "uid_allow_cid_allow_gid_deny_cid_deny_gid" => ["allow_cid(50)", "allow_gid(30)", "deny_cid(50)", "deny_gid(30)"],
231 "comment" => "tags and mentions",
233 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
234 "name" => ["type" => "varchar(96)", "not null" => "1", "default" => "", "comment" => ""],
235 "url" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""]
239 "type_name_url" => ["UNIQUE", "name", "url"],
244 "2fa_app_specific_password" => [
245 "comment" => "Two-factor app-specific _password",
247 "id" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Password ID for revocation"],
248 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "relation" => ["user" => "uid"], "comment" => "User ID"],
249 "description" => ["type" => "varchar(255)", "comment" => "Description of the usage of the password"],
250 "hashed_password" => ["type" => "varchar(255)", "not null" => "1", "comment" => "Hashed password"],
251 "generated" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the password was generated"],
252 "last_used" => ["type" => "datetime", "comment" => "Datetime the password was last used"],
256 "uid_description" => ["uid", "description(190)"],
259 "2fa_recovery_codes" => [
260 "comment" => "Two-factor authentication recovery codes",
262 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User ID"],
263 "code" => ["type" => "varchar(50)", "not null" => "1", "primary" => "1", "comment" => "Recovery code string"],
264 "generated" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the code was generated"],
265 "used" => ["type" => "datetime", "comment" => "Datetime the code was used"],
268 "PRIMARY" => ["uid", "code"]
272 "comment" => "registered addons",
274 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
275 "name" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "addon base (file)name"],
276 "version" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "currently unused"],
277 "installed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently always 1"],
278 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently unused"],
279 "timestamp" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "file timestamp to check for reloads"],
280 "plugin_admin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = has admin config, 0 = has no admin config"],
284 "name" => ["UNIQUE", "name"],
288 "comment" => "ActivityPub compatible contacts - used in the ActivityPub implementation",
290 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URL of the contact"],
291 "uuid" => ["type" => "varchar(255)", "comment" => ""],
292 "type" => ["type" => "varchar(20)", "not null" => "1", "comment" => ""],
293 "following" => ["type" => "varchar(255)", "comment" => ""],
294 "followers" => ["type" => "varchar(255)", "comment" => ""],
295 "inbox" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
296 "outbox" => ["type" => "varchar(255)", "comment" => ""],
297 "sharedinbox" => ["type" => "varchar(255)", "comment" => ""],
298 "manually-approve" => ["type" => "boolean", "comment" => ""],
299 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
300 "name" => ["type" => "varchar(255)", "comment" => ""],
301 "about" => ["type" => "text", "comment" => ""],
302 "photo" => ["type" => "varchar(255)", "comment" => ""],
303 "addr" => ["type" => "varchar(255)", "comment" => ""],
304 "alias" => ["type" => "varchar(255)", "comment" => ""],
305 "pubkey" => ["type" => "text", "comment" => ""],
306 "baseurl" => ["type" => "varchar(255)", "comment" => "baseurl of the ap contact"],
307 "gsid" => ["type" => "int unsigned", "foreign" => ["gserver" => "id", "on delete" => "restrict"], "comment" => "Global Server ID"],
308 "generator" => ["type" => "varchar(255)", "comment" => "Name of the contact's system"],
309 "following_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of following contacts"],
310 "followers_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of followers"],
311 "statuses_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of posts"],
312 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
315 "PRIMARY" => ["url"],
316 "addr" => ["addr(32)"],
317 "alias" => ["alias(190)"],
318 "followers" => ["followers(190)"],
323 "comment" => "file attachments",
325 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "generated index"],
326 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
327 "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "hash"],
328 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "filename of original"],
329 "filetype" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "mimetype"],
330 "filesize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "size in bytes"],
331 "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"],
332 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
333 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
334 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>"],
335 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
336 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
337 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
338 "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
339 "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"],
346 "comment" => "OAuth usage",
348 "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""],
349 "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "foreign" => ["clients" => "client_id"],
351 "redirect_uri" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
352 "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
353 "scope" => ["type" => "varchar(250)", "not null" => "1", "default" => "", "comment" => ""],
357 "client_id" => ["client_id"]
361 "comment" => "Stores temporary data",
363 "k" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "cache key"],
364 "v" => ["type" => "mediumtext", "comment" => "cached serialized value"],
365 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
366 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache insertion"],
370 "k_expires" => ["k", "expires"],
376 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
377 "challenge" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
378 "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
379 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
380 "type" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
381 "last_update" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
388 "comment" => "main configuration storage",
390 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
391 "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
392 "k" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
393 "v" => ["type" => "mediumtext", "comment" => ""],
397 "cat_k" => ["UNIQUE", "cat", "k"],
400 "contact-relation" => [
401 "comment" => "Contact relations",
403 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "primary" => "1", "comment" => "contact the related contact had interacted with"],
404 "relation-cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "primary" => "1", "comment" => "related contact who had interacted with the contact"],
405 "last-interaction" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last interaction"],
408 "PRIMARY" => ["cid", "relation-cid"],
409 "relation-cid" => ["relation-cid"],
413 "comment" => "private messages",
415 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
416 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this conversation"],
417 "recips" => ["type" => "text", "comment" => "sender_handle;recipient_handle"],
418 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
419 "creator" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "handle of creator"],
420 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation timestamp"],
421 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "edited timestamp"],
422 "subject" => ["type" => "text", "comment" => "subject of initial message"],
430 "comment" => "Raw data and structure information for messages",
432 "item-uri" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "Original URI of the item - unrelated to the table with the same name"],
433 "reply-to-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "URI to which this item is a reply"],
434 "conversation-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation URI"],
435 "conversation-href" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation link"],
436 "protocol" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "255", "comment" => "The protocol of the item"],
437 "direction" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "How the message arrived here: 1=push, 2=pull"],
438 "source" => ["type" => "mediumtext", "comment" => "Original source"],
439 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Receiving date"],
442 "PRIMARY" => ["item-uri"],
443 "conversation-uri" => ["conversation-uri"],
444 "received" => ["received"],
447 "diaspora-interaction" => [
448 "comment" => "Signed Diaspora Interaction",
450 "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"],
451 "interaction" => ["type" => "mediumtext", "comment" => "The Diaspora interaction"]
454 "PRIMARY" => ["uri-id"]
458 "comment" => "Events",
460 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
461 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
462 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
463 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact_id (ID of the contact in contact table)"],
464 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
465 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
466 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
467 "start" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event start time"],
468 "finish" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event end time"],
469 "summary" => ["type" => "text", "comment" => "short description or title of the event"],
470 "desc" => ["type" => "text", "comment" => "event description"],
471 "location" => ["type" => "text", "comment" => "event location"],
472 "type" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => "event or birthday"],
473 "nofinish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if event does have no end this is 1"],
474 "adjust" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "adjust to timezone of the recipient (0 or 1)"],
475 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "0 or 1"],
476 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
477 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
478 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
479 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
483 "uid_start" => ["uid", "start"],
487 "comment" => "Diaspora compatible contacts - used in the Diaspora implementation",
489 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
490 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "unique id"],
491 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
492 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
493 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
494 "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
495 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
496 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
497 "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
498 "notify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
499 "poll" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
500 "confirm" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
501 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
502 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
503 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
504 "pubkey" => ["type" => "text", "comment" => ""],
505 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
509 "addr" => ["addr(32)"],
510 "url" => ["UNIQUE", "url(190)"],
514 "comment" => "friend suggestion stuff",
516 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
517 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
518 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
519 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
520 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
521 "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
522 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
523 "note" => ["type" => "text", "comment" => ""],
524 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
531 "comment" => "contacts ignored by friend suggestions",
533 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
534 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Local User id"],
535 "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => "gcontact.id of ignored contact"],
544 "comment" => "global contacts",
546 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
547 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"],
548 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"],
549 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the contacts profile page"],
550 "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
551 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the profile photo"],
552 "connect" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
553 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
554 "updated" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
555 "last_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
556 "last_failure" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
557 "last_discovery" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last contact discovery"],
558 "archive_date" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
559 "archived" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
560 "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
561 "about" => ["type" => "text", "comment" => ""],
562 "keywords" => ["type" => "text", "comment" => "puplic keywords (interests)"],
563 "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Deprecated"],
564 "birthday" => ["type" => "varchar(32)", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""],
565 "community" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if contact is forum account"],
566 "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "-1", "comment" => ""],
567 "hide" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = should be hidden from search"],
568 "nsfw" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = contact posts nsfw content"],
569 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "social network protocol"],
570 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
571 "notify" => ["type" => "varchar(255)", "comment" => ""],
572 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
573 "generation" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
574 "server_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "baseurl of the contacts server"],
575 "gsid" => ["type" => "int unsigned", "foreign" => ["gserver" => "id", "on delete" => "restrict"], "comment" => "Global Server ID"],
579 "nurl" => ["UNIQUE", "nurl(190)"],
580 "name" => ["name(64)"],
581 "nick" => ["nick(32)"],
582 "addr" => ["addr(64)"],
583 "hide_network_updated" => ["hide", "network", "updated"],
584 "updated" => ["updated"],
589 "comment" => "Followers of global contacts",
591 "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["gcontact" => "id"], "comment" => "global contact"],
592 "follower-gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["gcontact" => "id"], "comment" => "global contact of the follower"],
593 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates that the connection has been deleted"],
596 "PRIMARY" => ["gcid", "follower-gcid"],
597 "follower-gcid" => ["follower-gcid"],
601 "comment" => "'friends of friends' linkages derived from poco",
603 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
604 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
605 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
606 "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
607 "zcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
608 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
612 "cid_uid_gcid_zcid" => ["UNIQUE", "cid", "uid", "gcid", "zcid"],
617 "comment" => "privacy groups, group info",
619 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
620 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
621 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the member list is not private"],
622 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the group has been deleted"],
623 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "human readable name of group"],
631 "comment" => "privacy groups, member info",
633 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
634 "gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["group" => "id"], "comment" => "groups.id of the associated group"],
635 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id of the member assigned to the associated group"],
639 "contactid" => ["contact-id"],
640 "gid_contactid" => ["UNIQUE", "gid", "contact-id"],
644 "comment" => "Tags that the server has subscribed",
646 "gserver-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gserver" => "id"], "primary" => "1",
647 "comment" => "The id of the gserver"],
648 "tag" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "primary" => "1", "comment" => "Tag that the server has subscribed"],
651 "PRIMARY" => ["gserver-id", "tag"],
656 "comment" => "addon hook registry",
658 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
659 "hook" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => "name of hook"],
660 "file" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "relative filename of hook handler"],
661 "function" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "function name of hook handler"],
662 "priority" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => "not yet implemented - can be used to sort conflicts in hook handling by calling handlers in priority order"],
666 "hook_file_function" => ["UNIQUE", "hook", "file", "function"],
670 "comment" => "Status of ActivityPub inboxes",
672 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URL of the inbox"],
673 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date of this entry"],
674 "success" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful delivery"],
675 "failure" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed delivery"],
676 "previous" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Previous delivery date"],
677 "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the inbox archived?"],
678 "shared" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is it a shared inbox?"]
687 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
688 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
689 "fid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["fcontact" => "id"], "comment" => ""],
690 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
691 "knowyou" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
692 "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
693 "note" => ["type" => "text", "comment" => ""],
694 "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
695 "datetime" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
696 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
697 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
704 "comment" => "Structure for all posts",
706 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
707 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this item"],
708 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
709 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
710 "uri-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
711 "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"],
712 "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "uri of the parent to this item"],
713 "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the parent uri"],
714 "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"],
715 "thr-parent-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"],
716 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation timestamp."],
717 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last edit (default is created)"],
718 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last comment/reply to this item"],
719 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime"],
720 "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"],
721 "gravity" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
722 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network from where the item comes from"],
723 "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"],
724 "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"],
725 "icid" => ["type" => "int unsigned", "relation" => ["item-content" => "id"], "comment" => "Id of the item-content table entry that contains the whole item content"],
726 "iaid" => ["type" => "int unsigned", "relation" => ["item-activity" => "id"], "comment" => "Id of the item-activity table entry that contains the activity data"],
727 "vid" => ["type" => "smallint unsigned", "relation" => ["verb" => "id"], "comment" => "Id of the verb table entry that contains the activity verbs"],
728 "extid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
729 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"],
730 "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
731 "private" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "0=public, 1=private, 2=unlisted"],
732 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
733 "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
734 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been deleted"],
735 // User specific fields. Eventually they will move to user-item
736 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
737 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
738 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "This item was posted to the wall of uid"],
739 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item originated at this site"],
740 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
741 "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been favourited"],
742 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "item has not been seen"],
743 "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "The owner of this item was mentioned in it"],
744 "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
745 "psid" => ["type" => "int unsigned", "foreign" => ["permissionset" => "id", "on delete" => "restrict"], "comment" => "ID of the permission set of this post"],
746 // It has to be decided whether these fields belong to the user or the structure
747 "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"],
748 "event-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["event" => "id"], "comment" => "Used to link to the event.id"],
749 // Could possibly be replaced by the "attach" table?
750 "attach" => ["type" => "mediumtext", "comment" => "JSON structure representing attachments to this item"],
751 // Deprecated fields. Will be removed in upcoming versions
752 "allow_cid" => ["type" => "mediumtext", "comment" => "Deprecated"],
753 "allow_gid" => ["type" => "mediumtext", "comment" => "Deprecated"],
754 "deny_cid" => ["type" => "mediumtext", "comment" => "Deprecated"],
755 "deny_gid" => ["type" => "mediumtext", "comment" => "Deprecated"],
756 "postopts" => ["type" => "text", "comment" => "Deprecated"],
757 "inform" => ["type" => "mediumtext", "comment" => "Deprecated"],
758 "type" => ["type" => "varchar(20)", "comment" => "Deprecated"],
759 "bookmark" => ["type" => "boolean", "comment" => "Deprecated"],
760 "file" => ["type" => "mediumtext", "comment" => "Deprecated"],
761 "location" => ["type" => "varchar(255)", "comment" => "Deprecated"],
762 "coord" => ["type" => "varchar(255)", "comment" => "Deprecated"],
763 "tag" => ["type" => "mediumtext", "comment" => "Deprecated"],
764 "plink" => ["type" => "varchar(255)", "comment" => "Deprecated"],
765 "title" => ["type" => "varchar(255)", "comment" => "Deprecated"],
766 "content-warning" => ["type" => "varchar(255)", "comment" => "Deprecated"],
767 "body" => ["type" => "mediumtext", "comment" => "Deprecated"],
768 "app" => ["type" => "varchar(255)", "comment" => "Deprecated"],
769 "verb" => ["type" => "varchar(100)", "comment" => "Deprecated"],
770 "object-type" => ["type" => "varchar(100)", "comment" => "Deprecated"],
771 "object" => ["type" => "text", "comment" => "Deprecated"],
772 "target-type" => ["type" => "varchar(100)", "comment" => "Deprecated"],
773 "target" => ["type" => "text", "comment" => "Deprecated"],
774 "author-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
775 "author-link" => ["type" => "varchar(255)", "comment" => "Deprecated"],
776 "author-avatar" => ["type" => "varchar(255)", "comment" => "Deprecated"],
777 "owner-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
778 "owner-link" => ["type" => "varchar(255)", "comment" => "Deprecated"],
779 "owner-avatar" => ["type" => "varchar(255)", "comment" => "Deprecated"],
780 "rendered-hash" => ["type" => "varchar(32)", "comment" => "Deprecated"],
781 "rendered-html" => ["type" => "mediumtext", "comment" => "Deprecated"],
785 "guid" => ["guid(191)"],
786 "uri" => ["uri(191)"],
787 "parent" => ["parent"],
788 "parent-uri" => ["parent-uri(191)"],
789 "extid" => ["extid(191)"],
790 "uid_id" => ["uid", "id"],
791 "uid_contactid_id" => ["uid", "contact-id", "id"],
792 "uid_received" => ["uid", "received"],
793 "uid_commented" => ["uid", "commented"],
794 "uid_unseen_contactid" => ["uid", "unseen", "contact-id"],
795 "uid_network_received" => ["uid", "network", "received"],
796 "uid_network_commented" => ["uid", "network", "commented"],
797 "uid_thrparent" => ["uid", "thr-parent(190)"],
798 "uid_parenturi" => ["uid", "parent-uri(190)"],
799 "uid_contactid_received" => ["uid", "contact-id", "received"],
800 "authorid_received" => ["author-id", "received"],
801 "ownerid" => ["owner-id"],
802 "contact-id" => ["contact-id"],
803 "uid_uri" => ["uid", "uri(190)"],
804 "resource-id" => ["resource-id"],
805 "deleted_changed" => ["deleted", "changed"],
806 "uid_wall_changed" => ["uid", "wall", "changed"],
807 "mention_uid_id" => ["mention", "uid", "id"],
808 "uid_eventid" => ["uid", "event-id"],
811 "psid_wall" => ["psid", "wall"],
812 "uri-id" => ["uri-id"],
813 "parent-uri-id" => ["parent-uri-id"],
814 "thr-parent-id" => ["thr-parent-id"],
818 "comment" => "Activities for items",
820 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
821 "uri" => ["type" => "varchar(255)", "comment" => ""],
822 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
823 "uri-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
824 "activity" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""]
828 "uri-hash" => ["UNIQUE", "uri-hash"],
829 "uri" => ["uri(191)"],
830 "uri-id" => ["uri-id"]
834 "comment" => "Content for all posts",
836 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
837 "uri" => ["type" => "varchar(255)", "comment" => ""],
838 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
839 "uri-plink-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
840 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "item title"],
841 "content-warning" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
842 "body" => ["type" => "mediumtext", "comment" => "item body content"],
843 "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "text location where this item originated"],
844 "coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "longitude/latitude pair representing location where this item originated"],
845 "language" => ["type" => "text", "comment" => "Language information about this post"],
846 "app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "application which generated this item"],
847 "rendered-hash" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
848 "rendered-html" => ["type" => "mediumtext", "comment" => "item.body converted to html"],
849 "object-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams object type"],
850 "object" => ["type" => "text", "comment" => "JSON encoded object structure unless it is an implied object (normal post)"],
851 "target-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams target type if applicable (URI)"],
852 "target" => ["type" => "text", "comment" => "JSON encoded target structure if used"],
853 "plink" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "permalink or URL to a displayable copy of the message at its source"],
854 "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams verb"]
858 "uri-plink-hash" => ["UNIQUE", "uri-plink-hash"],
859 "uri" => ["uri(191)"],
860 "plink" => ["plink(191)"],
861 "uri-id" => ["uri-id"]
867 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
868 "name" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => ""],
869 "locked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
870 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process ID"],
871 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
875 "name_expires" => ["name", "expires"]
879 "comment" => "private messages",
881 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
882 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
883 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this private message"],
884 "from-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "name of the sender"],
885 "from-photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "contact photo link of the sender"],
886 "from-url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "profile linke of the sender"],
887 "contact-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "relation" => ["contact" => "id"], "comment" => "contact.id"],
888 "convid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["conv" => "id"], "comment" => "conv.id"],
889 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
890 "body" => ["type" => "mediumtext", "comment" => ""],
891 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if message visited it is 1"],
892 "reply" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
893 "replied" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
894 "unknown" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if sender not in the contact table this is 1"],
895 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
896 "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
897 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time of the private message"],
901 "uid_seen" => ["uid", "seen"],
902 "convid" => ["convid"],
903 "uri" => ["uri(64)"],
904 "parent-uri" => ["parent-uri(64)"],
905 "contactid" => ["contact-id(32)"],
909 "comment" => "Mail account data for fetching mails",
911 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
912 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
913 "server" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
914 "port" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
915 "ssltype" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
916 "mailbox" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
917 "user" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
918 "pass" => ["type" => "text", "comment" => ""],
919 "reply_to" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
920 "action" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
921 "movetofolder" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
922 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
923 "last_check" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
930 "comment" => "table of accounts that can manage each other",
932 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
933 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
934 "mid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
938 "uid_mid" => ["UNIQUE", "uid", "mid"],
942 "comment" => "notifications",
944 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
945 "type" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
946 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
947 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
948 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
949 "date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
950 "msg" => ["type" => "mediumtext", "comment" => ""],
951 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
952 "link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
953 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id"],
954 "parent" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
955 "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Item-uri id of the related post"],
956 "parent-uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related post"],
957 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
958 "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""],
959 "otype" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => ""],
960 "name_cache" => ["type" => "tinytext", "comment" => "Cached bbcode parsing of name"],
961 "msg_cache" => ["type" => "mediumtext", "comment" => "Cached bbcode parsing of msg"]
965 "seen_uid_date" => ["seen", "uid", "date"],
966 "uid_date" => ["uid", "date"],
967 "uid_type_link" => ["uid", "type", "link(190)"],
970 "notify-threads" => [
973 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
974 "notify-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["notify" => "id"], "comment" => ""],
975 "master-parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
976 "master-parent-uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related post"],
977 "parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
978 "receiver-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"],
979 "comment" => "User id"],
983 "master-parent-uri-id" => ["master-parent-uri-id"],
987 "comment" => "cache for OEmbed queries",
989 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
990 "maxwidth" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "comment" => "Maximum width passed to Oembed"],
991 "content" => ["type" => "mediumtext", "comment" => "OEmbed data of the page"],
992 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
995 "PRIMARY" => ["url", "maxwidth"],
996 "created" => ["created"],
999 "openwebauth-token" => [
1000 "comment" => "Store OpenWebAuth token to verify contacts",
1002 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1003 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1004 "type" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Verify type"],
1005 "token" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A generated token"],
1006 "meta" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1007 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
1010 "PRIMARY" => ["id"],
1014 "comment" => "cache for 'parse_url' queries",
1016 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
1017 "guessing" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the 'guessing' mode active?"],
1018 "oembed" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the data the result of oembed?"],
1019 "content" => ["type" => "mediumtext", "comment" => "page data"],
1020 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
1023 "PRIMARY" => ["url", "guessing", "oembed"],
1024 "created" => ["created"],
1027 "participation" => [
1028 "comment" => "Storage for participation messages from Diaspora",
1030 "iid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["item" => "id"], "comment" => ""],
1031 "server" => ["type" => "varchar(60)", "not null" => "1", "primary" => "1", "comment" => ""],
1032 "cid" => ["type" => "int unsigned", "not null" => "1", "relation" => ["contact" => "id"], "comment" => ""],
1033 "fid" => ["type" => "int unsigned", "not null" => "1", "relation" => ["fcontact" => "id"], "comment" => ""],
1036 "PRIMARY" => ["iid", "server"],
1042 "comment" => "personal (per user) configuration storage",
1044 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
1045 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1046 "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
1047 "k" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => ""],
1048 "v" => ["type" => "mediumtext", "comment" => ""],
1051 "PRIMARY" => ["id"],
1052 "uid_cat_k" => ["UNIQUE", "uid", "cat", "k"],
1056 "comment" => "photo storage",
1058 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1059 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
1060 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
1061 "guid" => ["type" => "char(16)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this photo"],
1062 "resource-id" => ["type" => "char(32)", "not null" => "1", "default" => "", "comment" => ""],
1063 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation date"],
1064 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edited date"],
1065 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1066 "desc" => ["type" => "text", "comment" => ""],
1067 "album" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "The name of the album to which the photo belongs"],
1068 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1069 "type" => ["type" => "varchar(30)", "not null" => "1", "default" => "image/jpeg"],
1070 "height" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1071 "width" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1072 "datasize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1073 "data" => ["type" => "mediumblob", "not null" => "1", "comment" => ""],
1074 "scale" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1075 "profile" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1076 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
1077 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
1078 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
1079 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
1080 "accessible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Make photo publicly accessible, ignoring permissions"],
1081 "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
1082 "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"],
1083 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
1086 "PRIMARY" => ["id"],
1087 "contactid" => ["contact-id"],
1088 "uid_contactid" => ["uid", "contact-id"],
1089 "uid_profile" => ["uid", "profile"],
1090 "uid_album_scale_created" => ["uid", "album(32)", "scale", "created"],
1091 "uid_album_resource-id_created" => ["uid", "album(32)", "resource-id", "created"],
1092 "resource-id" => ["resource-id"],
1096 "comment" => "Currently unused table for storing poll results",
1098 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
1099 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1100 "q0" => ["type" => "text", "comment" => ""],
1101 "q1" => ["type" => "text", "comment" => ""],
1102 "q2" => ["type" => "text", "comment" => ""],
1103 "q3" => ["type" => "text", "comment" => ""],
1104 "q4" => ["type" => "text", "comment" => ""],
1105 "q5" => ["type" => "text", "comment" => ""],
1106 "q6" => ["type" => "text", "comment" => ""],
1107 "q7" => ["type" => "text", "comment" => ""],
1108 "q8" => ["type" => "text", "comment" => ""],
1109 "q9" => ["type" => "text", "comment" => ""],
1112 "PRIMARY" => ["id"],
1117 "comment" => "data for polls - currently unused",
1119 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1120 "poll_id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["poll" => "id"]],
1121 "choice" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1124 "PRIMARY" => ["id"],
1125 "poll_id" => ["poll_id"],
1128 "post-category" => [
1129 "comment" => "post relation to categories",
1131 "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"],
1132 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
1133 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "comment" => ""],
1134 "tid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["tag" => "id", "on delete" => "restrict"], "comment" => ""],
1137 "PRIMARY" => ["uri-id", "uid", "type", "tid"],
1141 "post-delivery-data" => [
1142 "comment" => "Delivery data for items",
1144 "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"],
1145 "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"],
1146 "inform" => ["type" => "mediumtext", "comment" => "Additional receivers of the linked item"],
1147 "queue_count" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Initial number of delivery recipients, used as item.delivery_queue_count"],
1148 "queue_done" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries, used as item.delivery_queue_done"],
1149 "queue_failed" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of unsuccessful deliveries, used as item.delivery_queue_failed"],
1150 "activitypub" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via ActivityPub"],
1151 "dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via DFRN"],
1152 "legacy_dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via legacy DFRN"],
1153 "diaspora" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via Diaspora"],
1154 "ostatus" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via OStatus"],
1157 "PRIMARY" => ["uri-id"],
1161 "comment" => "post relation to tags",
1163 "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"],
1164 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "comment" => ""],
1165 "tid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["tag" => "id", "on delete" => "restrict"], "comment" => ""],
1166 "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"],
1169 "PRIMARY" => ["uri-id", "type", "tid", "cid"],
1175 "comment" => "Currently running system processes",
1177 "pid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "comment" => ""],
1178 "command" => ["type" => "varbinary(32)", "not null" => "1", "default" => "", "comment" => ""],
1179 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1182 "PRIMARY" => ["pid"],
1183 "command" => ["command"],
1187 "comment" => "user profiles data",
1189 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1190 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
1191 "profile-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1192 "is-default" => ["type" => "boolean", "comment" => "Deprecated"],
1193 "hide-friends" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide friend list from viewers of this profile"],
1194 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1195 "pdesc" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1196 "dob" => ["type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00", "comment" => "Day of birth"],
1197 "address" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1198 "locality" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1199 "region" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1200 "postal-code" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1201 "country-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1202 "hometown" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1203 "gender" => ["type" => "varchar(32)", "comment" => "Deprecated"],
1204 "marital" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1205 "with" => ["type" => "text", "comment" => "Deprecated"],
1206 "howlong" => ["type" => "datetime", "comment" => "Deprecated"],
1207 "sexual" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1208 "politic" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1209 "religion" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1210 "pub_keywords" => ["type" => "text", "comment" => ""],
1211 "prv_keywords" => ["type" => "text", "comment" => ""],
1212 "likes" => ["type" => "text", "comment" => "Deprecated"],
1213 "dislikes" => ["type" => "text", "comment" => "Deprecated"],
1214 "about" => ["type" => "text", "comment" => "Profile description"],
1215 "summary" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1216 "music" => ["type" => "text", "comment" => "Deprecated"],
1217 "book" => ["type" => "text", "comment" => "Deprecated"],
1218 "tv" => ["type" => "text", "comment" => "Deprecated"],
1219 "film" => ["type" => "text", "comment" => "Deprecated"],
1220 "interest" => ["type" => "text", "comment" => "Deprecated"],
1221 "romance" => ["type" => "text", "comment" => "Deprecated"],
1222 "work" => ["type" => "text", "comment" => "Deprecated"],
1223 "education" => ["type" => "text", "comment" => "Deprecated"],
1224 "contact" => ["type" => "text", "comment" => "Deprecated"],
1225 "homepage" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1226 "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1227 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1228 "thumb" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1229 "publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish default profile in local directory"],
1230 "net-publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish profile in global directory"],
1233 "PRIMARY" => ["id"],
1234 "uid_is-default" => ["uid", "is-default"],
1235 "pub_keywords" => ["FULLTEXT", "pub_keywords"],
1238 "profile_check" => [
1239 "comment" => "DFRN remote auth use",
1241 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1242 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1243 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
1244 "dfrn_id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1245 "sec" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1246 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1249 "PRIMARY" => ["id"],
1252 "profile_field" => [
1253 "comment" => "Custom profile fields",
1255 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1256 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner user id"],
1257 "order" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "1", "comment" => "Field ordering per user"],
1258 "psid" => ["type" => "int unsigned", "foreign" => ["permissionset" => "id", "on delete" => "restrict"], "comment" => "ID of the permission set of this profile field - 0 = public"],
1259 "label" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Label of the field"],
1260 "value" => ["type" => "text", "comment" => "Value of the field"],
1261 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
1262 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
1265 "PRIMARY" => ["id"],
1267 "order" => ["order"],
1271 "push_subscriber" => [
1272 "comment" => "Used for OStatus: Contains feed subscribers",
1274 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1275 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1276 "callback_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1277 "topic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1278 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1279 "push" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1280 "last_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last successful trial"],
1281 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1282 "renewed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last subscription renewal"],
1283 "secret" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1286 "PRIMARY" => ["id"],
1287 "next_try" => ["next_try"],
1291 "comment" => "registrations requiring admin approval",
1293 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1294 "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1295 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1296 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1297 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1298 "language" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
1299 "note" => ["type" => "text", "comment" => ""],
1302 "PRIMARY" => ["id"],
1308 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1309 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1310 "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1313 "PRIMARY" => ["id"],
1318 "comment" => "web session storage",
1320 "id" => ["type" => "bigint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1321 "sid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
1322 "data" => ["type" => "text", "comment" => ""],
1323 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1326 "PRIMARY" => ["id"],
1327 "sid" => ["sid(64)"],
1328 "expire" => ["expire"],
1332 "comment" => "Data stored by Database storage backend",
1334 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented image data id"],
1335 "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"]
1342 "comment" => "Thread related data",
1344 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"],
1345 "comment" => "sequential ID"],
1346 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1347 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
1348 "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item owner"],
1349 "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item author"],
1350 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1351 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1352 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1353 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1354 "changed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1355 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1356 "private" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "0=public, 1=private, 2=unlisted"],
1357 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1358 "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1359 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1360 "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1361 "ignored" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1362 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"],
1363 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
1364 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1365 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1366 "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1367 "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1368 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
1369 "bookmark" => ["type" => "boolean", "comment" => ""],
1372 "PRIMARY" => ["iid"],
1373 "uid_network_commented" => ["uid", "network", "commented"],
1374 "uid_network_received" => ["uid", "network", "received"],
1375 "uid_contactid_commented" => ["uid", "contact-id", "commented"],
1376 "uid_contactid_received" => ["uid", "contact-id", "received"],
1377 "contactid" => ["contact-id"],
1378 "ownerid" => ["owner-id"],
1379 "authorid" => ["author-id"],
1380 "uid_received" => ["uid", "received"],
1381 "uid_commented" => ["uid", "commented"],
1382 "uid_wall_received" => ["uid", "wall", "received"],
1383 "private_wall_origin_commented" => ["private", "wall", "origin", "commented"],
1387 "comment" => "OAuth usage",
1389 "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""],
1390 "secret" => ["type" => "text", "comment" => ""],
1391 "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "foreign" => ["clients" => "client_id"]],
1392 "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
1393 "scope" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
1394 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1397 "PRIMARY" => ["id"],
1398 "client_id" => ["client_id"]
1402 "comment" => "The local users",
1404 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1405 "parent-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"],
1406 "comment" => "The parent user that has full control about this user"],
1407 "guid" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this user"],
1408 "username" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this user is known by"],
1409 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "encrypted password"],
1410 "legacy_password" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the password hash double-hashed?"],
1411 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "nick- and user name"],
1412 "email" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "the users email address"],
1413 "openid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1414 "timezone" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => "PHP-legal timezone"],
1415 "language" => ["type" => "varchar(32)", "not null" => "1", "default" => "en", "comment" => "default language"],
1416 "register_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of registration"],
1417 "login_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last login"],
1418 "default-location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Default for item.location"],
1419 "allow_location" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 allows to display the location"],
1420 "theme" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "user theme preference"],
1421 "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
1422 "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
1423 "spubkey" => ["type" => "text", "comment" => ""],
1424 "sprvkey" => ["type" => "text", "comment" => ""],
1425 "verified" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "user is verified through email"],
1426 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 for user is blocked"],
1427 "blockwall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to post to the profile page of the user"],
1428 "hidewall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide profile details from unkown viewers"],
1429 "blocktags" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to tag the post of this user"],
1430 "unkmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Permit unknown people to send private mails to this user"],
1431 "cntunkmail" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
1432 "notify-flags" => ["type" => "smallint unsigned", "not null" => "1", "default" => "65535", "comment" => "email notification options"],
1433 "page-flags" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "page/profile type"],
1434 "account-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1435 "prvnets" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1436 "pwdreset" => ["type" => "varchar(255)", "comment" => "Password reset request token"],
1437 "pwdreset_time" => ["type" => "datetime", "comment" => "Timestamp of the last password reset request"],
1438 "maxreq" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
1439 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1440 "account_removed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if 1 the account is removed"],
1441 "account_expired" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1442 "account_expires_on" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp when account expires and will be deleted"],
1443 "expire_notification_sent" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last warning of account expiration"],
1444 "def_gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1445 "allow_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1446 "allow_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1447 "deny_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1448 "deny_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1449 "openidserver" => ["type" => "text", "comment" => ""],
1452 "PRIMARY" => ["uid"],
1453 "nickname" => ["nickname(32)"],
1457 "comment" => "Deleted usernames",
1459 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1460 "username" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
1463 "PRIMARY" => ["id"],
1464 "username" => ["username(32)"],
1468 "comment" => "User specific public contact data",
1470 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["contact" => "id"], "comment" => "Contact id of the linked public contact"],
1471 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
1472 "blocked" => ["type" => "boolean", "comment" => "Contact is completely blocked for this user"],
1473 "ignored" => ["type" => "boolean", "comment" => "Posts from this contact are ignored"],
1474 "collapsed" => ["type" => "boolean", "comment" => "Posts from this contact are collapsed"]
1477 "PRIMARY" => ["uid", "cid"]
1481 "comment" => "User specific item data",
1483 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"], "comment" => "Item id"],
1484 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
1485 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide an item from the user"],
1486 "ignored" => ["type" => "boolean", "comment" => "Ignore this thread if set"],
1487 "pinned" => ["type" => "boolean", "comment" => "The item is pinned on the profile page"],
1488 "notification-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1491 "PRIMARY" => ["uid", "iid"],
1492 "uid_pinned" => ["uid", "pinned"],
1493 "iid_uid" => ["iid", "uid"]
1497 "comment" => "Activity Verbs",
1499 "id" => ["type" => "smallint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
1500 "name" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""]
1507 "comment" => "Inter process communication between the frontend and the worker",
1509 "key" => ["type" => "int", "not null" => "1", "primary" => "1", "comment" => ""],
1510 "jobs" => ["type" => "boolean", "comment" => "Flag for outstanding jobs"],
1513 "PRIMARY" => ["key"],
1515 "engine" => "MEMORY",
1518 "comment" => "Background tasks queue entries",
1520 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented worker task id"],
1521 "parameter" => ["type" => "mediumtext", "comment" => "Task command"],
1522 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Task priority"],
1523 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date"],
1524 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process id of the worker"],
1525 "executed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Execution date"],
1526 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1527 "retrial" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1528 "done" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marked 1 when the task was done - will be deleted later"],
1531 "PRIMARY" => ["id"],
1532 "done_parameter" => ["done", "parameter(64)"],
1533 "done_executed" => ["done", "executed"],
1534 "done_priority_created" => ["done", "priority", "created"],
1535 "done_priority_next_try" => ["done", "priority", "next_try"],
1536 "done_pid_next_try" => ["done", "pid", "next_try"],
1537 "done_pid_priority_created" => ["done", "pid", "priority", "created"]