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', 1359);
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" => ""],
85 "failed" => ["type" => "boolean", "comment" => "Connection failed"],
89 "nurl" => ["UNIQUE", "nurl(190)"],
93 "comment" => "OAuth usage",
95 "client_id" => ["type" => "varchar(20)", "not null" => "1", "primary" => "1", "comment" => ""],
96 "pw" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => ""],
97 "redirect_uri" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
98 "name" => ["type" => "text", "comment" => ""],
99 "icon" => ["type" => "text", "comment" => ""],
100 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
103 "PRIMARY" => ["client_id"],
107 "comment" => "contact table",
109 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
110 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
111 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
112 "updated" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Date of last contact update"],
113 "self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if the contact is the user him/her self"],
114 "remote_self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
115 "rel" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "The kind of the relation between the user and the contact"],
116 "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
117 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network of the contact"],
118 "protocol" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Protocol of the contact"],
119 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"],
120 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"],
121 "location" => ["type" => "varchar(255)", "default" => "", "comment" => ""],
122 "about" => ["type" => "text", "comment" => ""],
123 "keywords" => ["type" => "text", "comment" => "public keywords (interests) of the contact"],
124 "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Deprecated"],
125 "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
126 "attag" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
127 "avatar" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
128 "photo" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo of the contact"],
129 "thumb" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (thumb size)"],
130 "micro" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (micro size)"],
131 "site-pubkey" => ["type" => "text", "comment" => ""],
132 "issued-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
133 "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
134 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
135 "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
136 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
137 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
138 "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
139 "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
140 "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
141 "request" => ["type" => "varchar(255)", "comment" => ""],
142 "notify" => ["type" => "varchar(255)", "comment" => ""],
143 "poll" => ["type" => "varchar(255)", "comment" => ""],
144 "confirm" => ["type" => "varchar(255)", "comment" => ""],
145 "subscribe" => ["type" => "varchar(255)", "comment" => ""],
146 "poco" => ["type" => "varchar(255)", "comment" => ""],
147 "aes_allow" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
148 "ret-aes" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
149 "usehub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
150 "subhub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
151 "hub-verify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
152 "last-update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last try to update the contact info"],
153 "success_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful contact update"],
154 "failure_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed update"],
155 "failed" => ["type" => "boolean", "comment" => "Connection failed"],
156 "name-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
157 "uri-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
158 "avatar-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
159 "term-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
160 "last-item" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "date of the last post"],
161 "last-discovery" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "date of the last follower discovery"],
162 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
163 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "Node-wide block status"],
164 "block_reason" => ["type" => "text", "comment" => "Node-wide block reason"],
165 "readonly" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "posts of the contact are readonly"],
166 "writable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
167 "forum" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a forum"],
168 "prv" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a private group"],
169 "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
170 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
171 "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
172 "pending" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
173 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact has been deleted"],
174 "rating" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
175 "unsearchable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact prefers to not be searchable"],
176 "sensitive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact posts sensitive content"],
177 "baseurl" => ["type" => "varchar(255)", "default" => "", "comment" => "baseurl of the contact"],
178 "gsid" => ["type" => "int unsigned", "foreign" => ["gserver" => "id", "on delete" => "restrict"], "comment" => "Global Server ID"],
179 "reason" => ["type" => "text", "comment" => ""],
180 "closeness" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "99", "comment" => ""],
181 "info" => ["type" => "mediumtext", "comment" => ""],
182 "profile-id" => ["type" => "int unsigned", "comment" => "Deprecated"],
183 "bdyear" => ["type" => "varchar(4)", "not null" => "1", "default" => "", "comment" => ""],
184 "bd" => ["type" => "date", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""],
185 "notify_new_posts" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
186 "fetch_further_information" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
187 "ffi_keyword_denylist" => ["type" => "text", "comment" => ""],
191 "uid_name" => ["uid", "name(190)"],
192 "self_uid" => ["self", "uid"],
193 "alias_uid" => ["alias(32)", "uid"],
194 "pending_uid" => ["pending", "uid"],
195 "blocked_uid" => ["blocked", "uid"],
196 "uid_rel_network_poll" => ["uid", "rel", "network", "poll(64)", "archive"],
197 "uid_network_batch" => ["uid", "network", "batch(64)"],
198 "addr_uid" => ["addr(32)", "uid"],
199 "nurl_uid" => ["nurl(32)", "uid"],
200 "nick_uid" => ["nick(32)", "uid"],
201 "attag_uid" => ["attag(32)", "uid"],
202 "dfrn-id" => ["dfrn-id(64)"],
203 "issued-id" => ["issued-id(64)"],
204 "network_uid_lastupdate" => ["network", "uid", "last-update"],
205 "uid_lastitem" => ["uid", "last-item"],
210 "comment" => "URI and GUID for items",
212 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
213 "uri" => ["type" => "varbinary(255)", "not null" => "1", "comment" => "URI of an item"],
214 "guid" => ["type" => "varbinary(255)", "comment" => "A unique identifier for an item"]
218 "uri" => ["UNIQUE", "uri"],
225 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
226 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner id of this permission set"],
227 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
228 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
229 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
230 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
234 "uid_allow_cid_allow_gid_deny_cid_deny_gid" => ["allow_cid(50)", "allow_gid(30)", "deny_cid(50)", "deny_gid(30)"],
238 "comment" => "tags and mentions",
240 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
241 "name" => ["type" => "varchar(96)", "not null" => "1", "default" => "", "comment" => ""],
242 "url" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""]
246 "type_name_url" => ["UNIQUE", "name", "url"],
251 "2fa_app_specific_password" => [
252 "comment" => "Two-factor app-specific _password",
254 "id" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Password ID for revocation"],
255 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "relation" => ["user" => "uid"], "comment" => "User ID"],
256 "description" => ["type" => "varchar(255)", "comment" => "Description of the usage of the password"],
257 "hashed_password" => ["type" => "varchar(255)", "not null" => "1", "comment" => "Hashed password"],
258 "generated" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the password was generated"],
259 "last_used" => ["type" => "datetime", "comment" => "Datetime the password was last used"],
263 "uid_description" => ["uid", "description(190)"],
266 "2fa_recovery_codes" => [
267 "comment" => "Two-factor authentication recovery codes",
269 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User ID"],
270 "code" => ["type" => "varchar(50)", "not null" => "1", "primary" => "1", "comment" => "Recovery code string"],
271 "generated" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the code was generated"],
272 "used" => ["type" => "datetime", "comment" => "Datetime the code was used"],
275 "PRIMARY" => ["uid", "code"]
279 "comment" => "registered addons",
281 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
282 "name" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "addon base (file)name"],
283 "version" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "currently unused"],
284 "installed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently always 1"],
285 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently unused"],
286 "timestamp" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "file timestamp to check for reloads"],
287 "plugin_admin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = has admin config, 0 = has no admin config"],
291 "name" => ["UNIQUE", "name"],
295 "comment" => "ActivityPub compatible contacts - used in the ActivityPub implementation",
297 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URL of the contact"],
298 "uuid" => ["type" => "varchar(255)", "comment" => ""],
299 "type" => ["type" => "varchar(20)", "not null" => "1", "comment" => ""],
300 "following" => ["type" => "varchar(255)", "comment" => ""],
301 "followers" => ["type" => "varchar(255)", "comment" => ""],
302 "inbox" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
303 "outbox" => ["type" => "varchar(255)", "comment" => ""],
304 "sharedinbox" => ["type" => "varchar(255)", "comment" => ""],
305 "manually-approve" => ["type" => "boolean", "comment" => ""],
306 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
307 "name" => ["type" => "varchar(255)", "comment" => ""],
308 "about" => ["type" => "text", "comment" => ""],
309 "photo" => ["type" => "varchar(255)", "comment" => ""],
310 "addr" => ["type" => "varchar(255)", "comment" => ""],
311 "alias" => ["type" => "varchar(255)", "comment" => ""],
312 "pubkey" => ["type" => "text", "comment" => ""],
313 "subscribe" => ["type" => "varchar(255)", "comment" => ""],
314 "baseurl" => ["type" => "varchar(255)", "comment" => "baseurl of the ap contact"],
315 "gsid" => ["type" => "int unsigned", "foreign" => ["gserver" => "id", "on delete" => "restrict"], "comment" => "Global Server ID"],
316 "generator" => ["type" => "varchar(255)", "comment" => "Name of the contact's system"],
317 "following_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of following contacts"],
318 "followers_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of followers"],
319 "statuses_count" => ["type" => "int unsigned", "default" => 0, "comment" => "Number of posts"],
320 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
323 "PRIMARY" => ["url"],
324 "addr" => ["addr(32)"],
325 "alias" => ["alias(190)"],
326 "followers" => ["followers(190)"],
327 "baseurl" => ["baseurl(190)"],
332 "comment" => "file attachments",
334 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "generated index"],
335 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
336 "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "hash"],
337 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "filename of original"],
338 "filetype" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "mimetype"],
339 "filesize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "size in bytes"],
340 "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"],
341 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
342 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
343 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>"],
344 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
345 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
346 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
347 "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
348 "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"],
355 "comment" => "OAuth usage",
357 "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""],
358 "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "foreign" => ["clients" => "client_id"],
360 "redirect_uri" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
361 "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
362 "scope" => ["type" => "varchar(250)", "not null" => "1", "default" => "", "comment" => ""],
366 "client_id" => ["client_id"]
370 "comment" => "Stores temporary data",
372 "k" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "cache key"],
373 "v" => ["type" => "mediumtext", "comment" => "cached serialized value"],
374 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
375 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache insertion"],
379 "k_expires" => ["k", "expires"],
385 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
386 "challenge" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
387 "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
388 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
389 "type" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
390 "last_update" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
397 "comment" => "main configuration storage",
399 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
400 "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
401 "k" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
402 "v" => ["type" => "mediumtext", "comment" => ""],
406 "cat_k" => ["UNIQUE", "cat", "k"],
409 "contact-relation" => [
410 "comment" => "Contact relations",
412 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "primary" => "1", "comment" => "contact the related contact had interacted with"],
413 "relation-cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "primary" => "1", "comment" => "related contact who had interacted with the contact"],
414 "last-interaction" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last interaction"],
415 "follow-updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last update of the contact relationship"],
416 "follows" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
419 "PRIMARY" => ["cid", "relation-cid"],
420 "relation-cid" => ["relation-cid"],
424 "comment" => "private messages",
426 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
427 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this conversation"],
428 "recips" => ["type" => "text", "comment" => "sender_handle;recipient_handle"],
429 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
430 "creator" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "handle of creator"],
431 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation timestamp"],
432 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "edited timestamp"],
433 "subject" => ["type" => "text", "comment" => "subject of initial message"],
441 "comment" => "Raw data and structure information for messages",
443 "item-uri" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "Original URI of the item - unrelated to the table with the same name"],
444 "reply-to-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "URI to which this item is a reply"],
445 "conversation-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation URI"],
446 "conversation-href" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation link"],
447 "protocol" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "255", "comment" => "The protocol of the item"],
448 "direction" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "How the message arrived here: 1=push, 2=pull"],
449 "source" => ["type" => "mediumtext", "comment" => "Original source"],
450 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Receiving date"],
453 "PRIMARY" => ["item-uri"],
454 "conversation-uri" => ["conversation-uri"],
455 "received" => ["received"],
458 "diaspora-interaction" => [
459 "comment" => "Signed Diaspora Interaction",
461 "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"],
462 "interaction" => ["type" => "mediumtext", "comment" => "The Diaspora interaction"]
465 "PRIMARY" => ["uri-id"]
469 "comment" => "Events",
471 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
472 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
473 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
474 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact_id (ID of the contact in contact table)"],
475 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
476 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
477 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
478 "start" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event start time"],
479 "finish" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event end time"],
480 "summary" => ["type" => "text", "comment" => "short description or title of the event"],
481 "desc" => ["type" => "text", "comment" => "event description"],
482 "location" => ["type" => "text", "comment" => "event location"],
483 "type" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => "event or birthday"],
484 "nofinish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if event does have no end this is 1"],
485 "adjust" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "adjust to timezone of the recipient (0 or 1)"],
486 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "0 or 1"],
487 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
488 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
489 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
490 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
494 "uid_start" => ["uid", "start"],
498 "comment" => "Diaspora compatible contacts - used in the Diaspora implementation",
500 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
501 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "unique id"],
502 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
503 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
504 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
505 "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
506 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
507 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
508 "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
509 "notify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
510 "poll" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
511 "confirm" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
512 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
513 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
514 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
515 "pubkey" => ["type" => "text", "comment" => ""],
516 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
520 "addr" => ["addr(32)"],
521 "url" => ["UNIQUE", "url(190)"],
525 "comment" => "friend suggestion stuff",
527 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
528 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
529 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
530 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
531 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
532 "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
533 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
534 "note" => ["type" => "text", "comment" => ""],
535 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
542 "comment" => "privacy groups, group info",
544 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
545 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
546 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the member list is not private"],
547 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the group has been deleted"],
548 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "human readable name of group"],
556 "comment" => "privacy groups, member info",
558 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
559 "gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["group" => "id"], "comment" => "groups.id of the associated group"],
560 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id of the member assigned to the associated group"],
564 "contactid" => ["contact-id"],
565 "gid_contactid" => ["UNIQUE", "gid", "contact-id"],
569 "comment" => "Tags that the server has subscribed",
571 "gserver-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gserver" => "id"], "primary" => "1",
572 "comment" => "The id of the gserver"],
573 "tag" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "primary" => "1", "comment" => "Tag that the server has subscribed"],
576 "PRIMARY" => ["gserver-id", "tag"],
581 "comment" => "addon hook registry",
583 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
584 "hook" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => "name of hook"],
585 "file" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "relative filename of hook handler"],
586 "function" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "function name of hook handler"],
587 "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"],
591 "hook_file_function" => ["UNIQUE", "hook", "file", "function"],
595 "comment" => "Status of ActivityPub inboxes",
597 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URL of the inbox"],
598 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date of this entry"],
599 "success" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful delivery"],
600 "failure" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed delivery"],
601 "previous" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Previous delivery date"],
602 "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the inbox archived?"],
603 "shared" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is it a shared inbox?"]
612 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
613 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
614 "fid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["fcontact" => "id"], "comment" => ""],
615 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
616 "knowyou" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
617 "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
618 "note" => ["type" => "text", "comment" => ""],
619 "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
620 "datetime" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
621 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
622 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
629 "comment" => "Structure for all posts",
631 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
632 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this item"],
633 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
634 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
635 "uri-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
636 "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"],
637 "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "uri of the parent to this item"],
638 "parent-uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the parent uri"],
639 "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"],
640 "thr-parent-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"],
641 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation timestamp."],
642 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last edit (default is created)"],
643 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last comment/reply to this item"],
644 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime"],
645 "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"],
646 "gravity" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
647 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network from where the item comes from"],
648 "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"],
649 "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"],
650 "icid" => ["type" => "int unsigned", "relation" => ["item-content" => "id"], "comment" => "Id of the item-content table entry that contains the whole item content"],
651 "iaid" => ["type" => "int unsigned", "relation" => ["item-activity" => "id"], "comment" => "Id of the item-activity table entry that contains the activity data"],
652 "vid" => ["type" => "smallint unsigned", "relation" => ["verb" => "id"], "comment" => "Id of the verb table entry that contains the activity verbs"],
653 "extid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
654 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"],
655 "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
656 "private" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "0=public, 1=private, 2=unlisted"],
657 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
658 "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
659 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been deleted"],
660 // User specific fields. Eventually they will move to user-item
661 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
662 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
663 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "This item was posted to the wall of uid"],
664 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item originated at this site"],
665 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
666 "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been favourited"],
667 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "item has not been seen"],
668 "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "The owner of this item was mentioned in it"],
669 "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
670 "psid" => ["type" => "int unsigned", "foreign" => ["permissionset" => "id", "on delete" => "restrict"], "comment" => "ID of the permission set of this post"],
671 // It has to be decided whether these fields belong to the user or the structure
672 "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"],
673 "event-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["event" => "id"], "comment" => "Used to link to the event.id"],
674 // Could possibly be replaced by the "attach" table?
675 "attach" => ["type" => "mediumtext", "comment" => "JSON structure representing attachments to this item"],
676 // Deprecated fields. Will be removed in upcoming versions
677 "allow_cid" => ["type" => "mediumtext", "comment" => "Deprecated"],
678 "allow_gid" => ["type" => "mediumtext", "comment" => "Deprecated"],
679 "deny_cid" => ["type" => "mediumtext", "comment" => "Deprecated"],
680 "deny_gid" => ["type" => "mediumtext", "comment" => "Deprecated"],
681 "postopts" => ["type" => "text", "comment" => "Deprecated"],
682 "inform" => ["type" => "mediumtext", "comment" => "Deprecated"],
683 "type" => ["type" => "varchar(20)", "comment" => "Deprecated"],
684 "bookmark" => ["type" => "boolean", "comment" => "Deprecated"],
685 "file" => ["type" => "mediumtext", "comment" => "Deprecated"],
686 "location" => ["type" => "varchar(255)", "comment" => "Deprecated"],
687 "coord" => ["type" => "varchar(255)", "comment" => "Deprecated"],
688 "tag" => ["type" => "mediumtext", "comment" => "Deprecated"],
689 "plink" => ["type" => "varchar(255)", "comment" => "Deprecated"],
690 "title" => ["type" => "varchar(255)", "comment" => "Deprecated"],
691 "content-warning" => ["type" => "varchar(255)", "comment" => "Deprecated"],
692 "body" => ["type" => "mediumtext", "comment" => "Deprecated"],
693 "app" => ["type" => "varchar(255)", "comment" => "Deprecated"],
694 "verb" => ["type" => "varchar(100)", "comment" => "Deprecated"],
695 "object-type" => ["type" => "varchar(100)", "comment" => "Deprecated"],
696 "object" => ["type" => "text", "comment" => "Deprecated"],
697 "target-type" => ["type" => "varchar(100)", "comment" => "Deprecated"],
698 "target" => ["type" => "text", "comment" => "Deprecated"],
699 "author-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
700 "author-link" => ["type" => "varchar(255)", "comment" => "Deprecated"],
701 "author-avatar" => ["type" => "varchar(255)", "comment" => "Deprecated"],
702 "owner-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
703 "owner-link" => ["type" => "varchar(255)", "comment" => "Deprecated"],
704 "owner-avatar" => ["type" => "varchar(255)", "comment" => "Deprecated"],
705 "rendered-hash" => ["type" => "varchar(32)", "comment" => "Deprecated"],
706 "rendered-html" => ["type" => "mediumtext", "comment" => "Deprecated"],
710 "guid" => ["guid(191)"],
711 "uri" => ["uri(191)"],
712 "parent" => ["parent"],
713 "parent-uri" => ["parent-uri(191)"],
714 "extid" => ["extid(191)"],
715 "uid_id" => ["uid", "id"],
716 "uid_contactid_id" => ["uid", "contact-id", "id"],
717 "uid_received" => ["uid", "received"],
718 "uid_commented" => ["uid", "commented"],
719 "uid_unseen_contactid" => ["uid", "unseen", "contact-id"],
720 "uid_network_received" => ["uid", "network", "received"],
721 "uid_network_commented" => ["uid", "network", "commented"],
722 "uid_thrparent" => ["uid", "thr-parent(190)"],
723 "uid_parenturi" => ["uid", "parent-uri(190)"],
724 "uid_contactid_received" => ["uid", "contact-id", "received"],
725 "authorid_received" => ["author-id", "received"],
726 "ownerid" => ["owner-id"],
727 "contact-id" => ["contact-id"],
728 "uid_uri" => ["uid", "uri(190)"],
729 "resource-id" => ["resource-id"],
730 "deleted_changed" => ["deleted", "changed"],
731 "uid_wall_changed" => ["uid", "wall", "changed"],
732 "mention_uid_id" => ["mention", "uid", "id"],
733 "uid_eventid" => ["uid", "event-id"],
736 "psid_wall" => ["psid", "wall"],
737 "uri-id" => ["uri-id"],
738 "parent-uri-id" => ["parent-uri-id"],
739 "thr-parent-id" => ["thr-parent-id"],
743 "comment" => "Activities for items",
745 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
746 "uri" => ["type" => "varchar(255)", "comment" => ""],
747 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
748 "uri-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
749 "activity" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""]
753 "uri-hash" => ["UNIQUE", "uri-hash"],
754 "uri" => ["uri(191)"],
755 "uri-id" => ["uri-id"]
759 "comment" => "Content for all posts",
761 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
762 "uri" => ["type" => "varchar(255)", "comment" => ""],
763 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
764 "uri-plink-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
765 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "item title"],
766 "content-warning" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
767 "body" => ["type" => "mediumtext", "comment" => "item body content"],
768 "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "text location where this item originated"],
769 "coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "longitude/latitude pair representing location where this item originated"],
770 "language" => ["type" => "text", "comment" => "Language information about this post"],
771 "app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "application which generated this item"],
772 "rendered-hash" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
773 "rendered-html" => ["type" => "mediumtext", "comment" => "item.body converted to html"],
774 "object-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams object type"],
775 "object" => ["type" => "text", "comment" => "JSON encoded object structure unless it is an implied object (normal post)"],
776 "target-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams target type if applicable (URI)"],
777 "target" => ["type" => "text", "comment" => "JSON encoded target structure if used"],
778 "plink" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "permalink or URL to a displayable copy of the message at its source"],
779 "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams verb"]
783 "uri-plink-hash" => ["UNIQUE", "uri-plink-hash"],
784 "uri" => ["uri(191)"],
785 "plink" => ["plink(191)"],
786 "uri-id" => ["uri-id"]
792 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
793 "name" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => ""],
794 "locked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
795 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process ID"],
796 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
800 "name_expires" => ["name", "expires"]
804 "comment" => "private messages",
806 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
807 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
808 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this private message"],
809 "from-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "name of the sender"],
810 "from-photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "contact photo link of the sender"],
811 "from-url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "profile linke of the sender"],
812 "contact-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "relation" => ["contact" => "id"], "comment" => "contact.id"],
813 "convid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["conv" => "id"], "comment" => "conv.id"],
814 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
815 "body" => ["type" => "mediumtext", "comment" => ""],
816 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if message visited it is 1"],
817 "reply" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
818 "replied" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
819 "unknown" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if sender not in the contact table this is 1"],
820 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
821 "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
822 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time of the private message"],
826 "uid_seen" => ["uid", "seen"],
827 "convid" => ["convid"],
828 "uri" => ["uri(64)"],
829 "parent-uri" => ["parent-uri(64)"],
830 "contactid" => ["contact-id(32)"],
834 "comment" => "Mail account data for fetching mails",
836 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
837 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
838 "server" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
839 "port" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
840 "ssltype" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
841 "mailbox" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
842 "user" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
843 "pass" => ["type" => "text", "comment" => ""],
844 "reply_to" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
845 "action" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
846 "movetofolder" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
847 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
848 "last_check" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
855 "comment" => "table of accounts that can manage each other",
857 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
858 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
859 "mid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
863 "uid_mid" => ["UNIQUE", "uid", "mid"],
867 "comment" => "notifications",
869 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
870 "type" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
871 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
872 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
873 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
874 "date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
875 "msg" => ["type" => "mediumtext", "comment" => ""],
876 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
877 "link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
878 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id"],
879 "parent" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
880 "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Item-uri id of the related post"],
881 "parent-uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related post"],
882 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
883 "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""],
884 "otype" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => ""],
885 "name_cache" => ["type" => "tinytext", "comment" => "Cached bbcode parsing of name"],
886 "msg_cache" => ["type" => "mediumtext", "comment" => "Cached bbcode parsing of msg"]
890 "seen_uid_date" => ["seen", "uid", "date"],
891 "uid_date" => ["uid", "date"],
892 "uid_type_link" => ["uid", "type", "link(190)"],
895 "notify-threads" => [
898 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
899 "notify-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["notify" => "id"], "comment" => ""],
900 "master-parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
901 "master-parent-uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Item-uri id of the parent of the related post"],
902 "parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
903 "receiver-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"],
904 "comment" => "User id"],
908 "master-parent-uri-id" => ["master-parent-uri-id"],
912 "comment" => "cache for OEmbed queries",
914 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
915 "maxwidth" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "comment" => "Maximum width passed to Oembed"],
916 "content" => ["type" => "mediumtext", "comment" => "OEmbed data of the page"],
917 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
920 "PRIMARY" => ["url", "maxwidth"],
921 "created" => ["created"],
924 "openwebauth-token" => [
925 "comment" => "Store OpenWebAuth token to verify contacts",
927 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
928 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
929 "type" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Verify type"],
930 "token" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A generated token"],
931 "meta" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
932 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
939 "comment" => "cache for 'parse_url' queries",
941 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
942 "guessing" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the 'guessing' mode active?"],
943 "oembed" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the data the result of oembed?"],
944 "content" => ["type" => "mediumtext", "comment" => "page data"],
945 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
948 "PRIMARY" => ["url", "guessing", "oembed"],
949 "created" => ["created"],
953 "comment" => "Storage for participation messages from Diaspora",
955 "iid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["item" => "id"], "comment" => ""],
956 "server" => ["type" => "varchar(60)", "not null" => "1", "primary" => "1", "comment" => ""],
957 "cid" => ["type" => "int unsigned", "not null" => "1", "relation" => ["contact" => "id"], "comment" => ""],
958 "fid" => ["type" => "int unsigned", "not null" => "1", "relation" => ["fcontact" => "id"], "comment" => ""],
961 "PRIMARY" => ["iid", "server"],
967 "comment" => "personal (per user) configuration storage",
969 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
970 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
971 "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
972 "k" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => ""],
973 "v" => ["type" => "mediumtext", "comment" => ""],
977 "uid_cat_k" => ["UNIQUE", "uid", "cat", "k"],
981 "comment" => "photo storage",
983 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
984 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
985 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
986 "guid" => ["type" => "char(16)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this photo"],
987 "resource-id" => ["type" => "char(32)", "not null" => "1", "default" => "", "comment" => ""],
988 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation date"],
989 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edited date"],
990 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
991 "desc" => ["type" => "text", "comment" => ""],
992 "album" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "The name of the album to which the photo belongs"],
993 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
994 "type" => ["type" => "varchar(30)", "not null" => "1", "default" => "image/jpeg"],
995 "height" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
996 "width" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
997 "datasize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
998 "data" => ["type" => "mediumblob", "not null" => "1", "comment" => ""],
999 "scale" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1000 "profile" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1001 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
1002 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
1003 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
1004 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
1005 "accessible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Make photo publicly accessible, ignoring permissions"],
1006 "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
1007 "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"],
1008 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
1011 "PRIMARY" => ["id"],
1012 "contactid" => ["contact-id"],
1013 "uid_contactid" => ["uid", "contact-id"],
1014 "uid_profile" => ["uid", "profile"],
1015 "uid_album_scale_created" => ["uid", "album(32)", "scale", "created"],
1016 "uid_album_resource-id_created" => ["uid", "album(32)", "resource-id", "created"],
1017 "resource-id" => ["resource-id"],
1021 "comment" => "Currently unused table for storing poll results",
1023 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
1024 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1025 "q0" => ["type" => "text", "comment" => ""],
1026 "q1" => ["type" => "text", "comment" => ""],
1027 "q2" => ["type" => "text", "comment" => ""],
1028 "q3" => ["type" => "text", "comment" => ""],
1029 "q4" => ["type" => "text", "comment" => ""],
1030 "q5" => ["type" => "text", "comment" => ""],
1031 "q6" => ["type" => "text", "comment" => ""],
1032 "q7" => ["type" => "text", "comment" => ""],
1033 "q8" => ["type" => "text", "comment" => ""],
1034 "q9" => ["type" => "text", "comment" => ""],
1037 "PRIMARY" => ["id"],
1042 "comment" => "data for polls - currently unused",
1044 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1045 "poll_id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["poll" => "id"]],
1046 "choice" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1049 "PRIMARY" => ["id"],
1050 "poll_id" => ["poll_id"],
1053 "post-category" => [
1054 "comment" => "post relation to categories",
1056 "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"],
1057 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
1058 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "comment" => ""],
1059 "tid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["tag" => "id", "on delete" => "restrict"], "comment" => ""],
1062 "PRIMARY" => ["uri-id", "uid", "type", "tid"],
1066 "post-delivery-data" => [
1067 "comment" => "Delivery data for items",
1069 "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"],
1070 "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"],
1071 "inform" => ["type" => "mediumtext", "comment" => "Additional receivers of the linked item"],
1072 "queue_count" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Initial number of delivery recipients, used as item.delivery_queue_count"],
1073 "queue_done" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries, used as item.delivery_queue_done"],
1074 "queue_failed" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of unsuccessful deliveries, used as item.delivery_queue_failed"],
1075 "activitypub" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via ActivityPub"],
1076 "dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via DFRN"],
1077 "legacy_dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via legacy DFRN"],
1078 "diaspora" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via Diaspora"],
1079 "ostatus" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via OStatus"],
1082 "PRIMARY" => ["uri-id"],
1086 "comment" => "post relation to tags",
1088 "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"],
1089 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "comment" => ""],
1090 "tid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "foreign" => ["tag" => "id", "on delete" => "restrict"], "comment" => ""],
1091 "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"],
1094 "PRIMARY" => ["uri-id", "type", "tid", "cid"],
1100 "comment" => "Currently running system processes",
1102 "pid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "comment" => ""],
1103 "command" => ["type" => "varbinary(32)", "not null" => "1", "default" => "", "comment" => ""],
1104 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1107 "PRIMARY" => ["pid"],
1108 "command" => ["command"],
1112 "comment" => "user profiles data",
1114 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1115 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
1116 "profile-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1117 "is-default" => ["type" => "boolean", "comment" => "Deprecated"],
1118 "hide-friends" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide friend list from viewers of this profile"],
1119 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1120 "pdesc" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1121 "dob" => ["type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00", "comment" => "Day of birth"],
1122 "address" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1123 "locality" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1124 "region" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1125 "postal-code" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1126 "country-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1127 "hometown" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1128 "gender" => ["type" => "varchar(32)", "comment" => "Deprecated"],
1129 "marital" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1130 "with" => ["type" => "text", "comment" => "Deprecated"],
1131 "howlong" => ["type" => "datetime", "comment" => "Deprecated"],
1132 "sexual" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1133 "politic" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1134 "religion" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1135 "pub_keywords" => ["type" => "text", "comment" => ""],
1136 "prv_keywords" => ["type" => "text", "comment" => ""],
1137 "likes" => ["type" => "text", "comment" => "Deprecated"],
1138 "dislikes" => ["type" => "text", "comment" => "Deprecated"],
1139 "about" => ["type" => "text", "comment" => "Profile description"],
1140 "summary" => ["type" => "varchar(255)", "comment" => "Deprecated"],
1141 "music" => ["type" => "text", "comment" => "Deprecated"],
1142 "book" => ["type" => "text", "comment" => "Deprecated"],
1143 "tv" => ["type" => "text", "comment" => "Deprecated"],
1144 "film" => ["type" => "text", "comment" => "Deprecated"],
1145 "interest" => ["type" => "text", "comment" => "Deprecated"],
1146 "romance" => ["type" => "text", "comment" => "Deprecated"],
1147 "work" => ["type" => "text", "comment" => "Deprecated"],
1148 "education" => ["type" => "text", "comment" => "Deprecated"],
1149 "contact" => ["type" => "text", "comment" => "Deprecated"],
1150 "homepage" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1151 "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1152 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1153 "thumb" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1154 "publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish default profile in local directory"],
1155 "net-publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish profile in global directory"],
1158 "PRIMARY" => ["id"],
1159 "uid_is-default" => ["uid", "is-default"],
1160 "pub_keywords" => ["FULLTEXT", "pub_keywords"],
1163 "profile_check" => [
1164 "comment" => "DFRN remote auth use",
1166 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1167 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1168 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
1169 "dfrn_id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1170 "sec" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1171 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1174 "PRIMARY" => ["id"],
1177 "profile_field" => [
1178 "comment" => "Custom profile fields",
1180 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1181 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner user id"],
1182 "order" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "1", "comment" => "Field ordering per user"],
1183 "psid" => ["type" => "int unsigned", "foreign" => ["permissionset" => "id", "on delete" => "restrict"], "comment" => "ID of the permission set of this profile field - 0 = public"],
1184 "label" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Label of the field"],
1185 "value" => ["type" => "text", "comment" => "Value of the field"],
1186 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
1187 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
1190 "PRIMARY" => ["id"],
1192 "order" => ["order"],
1196 "push_subscriber" => [
1197 "comment" => "Used for OStatus: Contains feed subscribers",
1199 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1200 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1201 "callback_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1202 "topic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1203 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1204 "push" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1205 "last_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last successful trial"],
1206 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1207 "renewed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last subscription renewal"],
1208 "secret" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1211 "PRIMARY" => ["id"],
1212 "next_try" => ["next_try"],
1216 "comment" => "registrations requiring admin approval",
1218 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1219 "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1220 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1221 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1222 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1223 "language" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
1224 "note" => ["type" => "text", "comment" => ""],
1227 "PRIMARY" => ["id"],
1233 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1234 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1235 "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1238 "PRIMARY" => ["id"],
1243 "comment" => "web session storage",
1245 "id" => ["type" => "bigint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1246 "sid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
1247 "data" => ["type" => "text", "comment" => ""],
1248 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1251 "PRIMARY" => ["id"],
1252 "sid" => ["sid(64)"],
1253 "expire" => ["expire"],
1257 "comment" => "Data stored by Database storage backend",
1259 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented image data id"],
1260 "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"]
1267 "comment" => "Thread related data",
1269 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"],
1270 "comment" => "sequential ID"],
1271 "uri-id" => ["type" => "int unsigned", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
1272 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1273 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
1274 "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item owner"],
1275 "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item author"],
1276 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1277 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1278 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1279 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1280 "changed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1281 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1282 "private" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "0=public, 1=private, 2=unlisted"],
1283 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1284 "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1285 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1286 "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1287 "ignored" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1288 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"],
1289 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
1290 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1291 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1292 "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1293 "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1294 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
1295 "bookmark" => ["type" => "boolean", "comment" => ""],
1298 "PRIMARY" => ["iid"],
1299 "uid_network_commented" => ["uid", "network", "commented"],
1300 "uid_network_received" => ["uid", "network", "received"],
1301 "uid_contactid_commented" => ["uid", "contact-id", "commented"],
1302 "uid_contactid_received" => ["uid", "contact-id", "received"],
1303 "contactid" => ["contact-id"],
1304 "ownerid" => ["owner-id"],
1305 "authorid" => ["author-id"],
1306 "uid_received" => ["uid", "received"],
1307 "uid_commented" => ["uid", "commented"],
1308 "uid_wall_received" => ["uid", "wall", "received"],
1309 "private_wall_origin_commented" => ["private", "wall", "origin", "commented"],
1310 "uri-id" => ["uri-id"],
1314 "comment" => "OAuth usage",
1316 "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""],
1317 "secret" => ["type" => "text", "comment" => ""],
1318 "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "foreign" => ["clients" => "client_id"]],
1319 "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
1320 "scope" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
1321 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1324 "PRIMARY" => ["id"],
1325 "client_id" => ["client_id"]
1329 "comment" => "The local users",
1331 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1332 "parent-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"],
1333 "comment" => "The parent user that has full control about this user"],
1334 "guid" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this user"],
1335 "username" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this user is known by"],
1336 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "encrypted password"],
1337 "legacy_password" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the password hash double-hashed?"],
1338 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "nick- and user name"],
1339 "email" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "the users email address"],
1340 "openid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1341 "timezone" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => "PHP-legal timezone"],
1342 "language" => ["type" => "varchar(32)", "not null" => "1", "default" => "en", "comment" => "default language"],
1343 "register_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of registration"],
1344 "login_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last login"],
1345 "default-location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Default for item.location"],
1346 "allow_location" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 allows to display the location"],
1347 "theme" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "user theme preference"],
1348 "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
1349 "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
1350 "spubkey" => ["type" => "text", "comment" => ""],
1351 "sprvkey" => ["type" => "text", "comment" => ""],
1352 "verified" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "user is verified through email"],
1353 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 for user is blocked"],
1354 "blockwall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to post to the profile page of the user"],
1355 "hidewall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide profile details from unkown viewers"],
1356 "blocktags" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to tag the post of this user"],
1357 "unkmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Permit unknown people to send private mails to this user"],
1358 "cntunkmail" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
1359 "notify-flags" => ["type" => "smallint unsigned", "not null" => "1", "default" => "65535", "comment" => "email notification options"],
1360 "page-flags" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "page/profile type"],
1361 "account-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1362 "prvnets" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1363 "pwdreset" => ["type" => "varchar(255)", "comment" => "Password reset request token"],
1364 "pwdreset_time" => ["type" => "datetime", "comment" => "Timestamp of the last password reset request"],
1365 "maxreq" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
1366 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1367 "account_removed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if 1 the account is removed"],
1368 "account_expired" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1369 "account_expires_on" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp when account expires and will be deleted"],
1370 "expire_notification_sent" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last warning of account expiration"],
1371 "def_gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1372 "allow_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1373 "allow_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1374 "deny_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1375 "deny_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1376 "openidserver" => ["type" => "text", "comment" => ""],
1379 "PRIMARY" => ["uid"],
1380 "nickname" => ["nickname(32)"],
1384 "comment" => "Deleted usernames",
1386 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1387 "username" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
1390 "PRIMARY" => ["id"],
1391 "username" => ["username(32)"],
1395 "comment" => "User specific public contact data",
1397 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["contact" => "id"], "comment" => "Contact id of the linked public contact"],
1398 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
1399 "blocked" => ["type" => "boolean", "comment" => "Contact is completely blocked for this user"],
1400 "ignored" => ["type" => "boolean", "comment" => "Posts from this contact are ignored"],
1401 "collapsed" => ["type" => "boolean", "comment" => "Posts from this contact are collapsed"]
1404 "PRIMARY" => ["uid", "cid"]
1408 "comment" => "User specific item data",
1410 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"], "comment" => "Item id"],
1411 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
1412 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide an item from the user"],
1413 "ignored" => ["type" => "boolean", "comment" => "Ignore this thread if set"],
1414 "pinned" => ["type" => "boolean", "comment" => "The item is pinned on the profile page"],
1415 "notification-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1418 "PRIMARY" => ["uid", "iid"],
1419 "uid_pinned" => ["uid", "pinned"],
1420 "iid_uid" => ["iid", "uid"]
1424 "comment" => "Activity Verbs",
1426 "id" => ["type" => "smallint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
1427 "name" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""]
1434 "comment" => "Inter process communication between the frontend and the worker",
1436 "key" => ["type" => "int", "not null" => "1", "primary" => "1", "comment" => ""],
1437 "jobs" => ["type" => "boolean", "comment" => "Flag for outstanding jobs"],
1440 "PRIMARY" => ["key"],
1442 "engine" => "MEMORY",
1445 "comment" => "Background tasks queue entries",
1447 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented worker task id"],
1448 "parameter" => ["type" => "mediumtext", "comment" => "Task command"],
1449 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Task priority"],
1450 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date"],
1451 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process id of the worker"],
1452 "executed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Execution date"],
1453 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1454 "retrial" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1455 "done" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marked 1 when the task was done - will be deleted later"],
1458 "PRIMARY" => ["id"],
1459 "done_parameter" => ["done", "parameter(64)"],
1460 "done_executed" => ["done", "executed"],
1461 "done_priority_created" => ["done", "priority", "created"],
1462 "done_priority_next_try" => ["done", "priority", "next_try"],
1463 "done_pid_next_try" => ["done", "pid", "next_try"],
1464 "done_pid_priority_created" => ["done", "pid", "priority", "created"]