3 /* Main database structure configuration file.
5 * Here are described all the tables, fields and indexes Friendica needs to work.
7 * Syntax (braces indicate optionale values):
9 * "comment" => "Description of the table",
12 * "type" => "<field type>{(<field size>)} <unsigned>",
14 * {"extra" => "auto_increment",}
15 * {"default" => "<default value>",}
16 * {"default" => NULL_DATE,} (for datetime fields)
18 * {"relation" => ["<foreign key table name>" => "<foreign key field name>"],}
19 * "comment" => "Description of the fields"
24 * "PRIMARY" => ["<primary key field name>", ...],
25 * "<index name>" => [{"UNIQUE",} "<field name>{(<key size>)}", ...]
30 * If you need to make any change, make sure to increment the DB_UPDATE_VERSION constant value below.
34 use Friendica\Database\DBA;
36 if (!defined('DB_UPDATE_VERSION')) {
37 define('DB_UPDATE_VERSION', 1324);
41 "2fa_app_specific_password" => [
42 "comment" => "Two-factor app-specific _password",
44 "id" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Password ID for revocation"],
45 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "relation" => ["user" => "uid"], "comment" => "User ID"],
46 "description" => ["type" => "varchar(255)", "comment" => "Description of the usage of the password"],
47 "hashed_password" => ["type" => "varchar(255)", "not null" => "1", "comment" => "Hashed password"],
48 "generated" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the password was generated"],
49 "last_used" => ["type" => "datetime", "comment" => "Datetime the password was last used"],
53 "uid_description" => ["uid", "description(190)"],
56 "2fa_recovery_codes" => [
57 "comment" => "Two-factor authentication recovery codes",
59 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User ID"],
60 "code" => ["type" => "varchar(50)", "not null" => "1", "primary" => "1", "comment" => "Recovery code string"],
61 "generated" => ["type" => "datetime", "not null" => "1", "comment" => "Datetime the code was generated"],
62 "used" => ["type" => "datetime", "comment" => "Datetime the code was used"],
65 "PRIMARY" => ["uid", "code"]
69 "comment" => "registered addons",
71 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
72 "name" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "addon base (file)name"],
73 "version" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "currently unused"],
74 "installed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently always 1"],
75 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently unused"],
76 "timestamp" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "file timestamp to check for reloads"],
77 "plugin_admin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = has admin config, 0 = has no admin config"],
81 "name" => ["UNIQUE", "name"],
85 "comment" => "ActivityPub compatible contacts - used in the ActivityPub implementation",
87 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URL of the contact"],
88 "uuid" => ["type" => "varchar(255)", "comment" => ""],
89 "type" => ["type" => "varchar(20)", "not null" => "1", "comment" => ""],
90 "following" => ["type" => "varchar(255)", "comment" => ""],
91 "followers" => ["type" => "varchar(255)", "comment" => ""],
92 "inbox" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
93 "outbox" => ["type" => "varchar(255)", "comment" => ""],
94 "sharedinbox" => ["type" => "varchar(255)", "comment" => ""],
95 "manually-approve" => ["type" => "boolean", "comment" => ""],
96 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
97 "name" => ["type" => "varchar(255)", "comment" => ""],
98 "about" => ["type" => "text", "comment" => ""],
99 "photo" => ["type" => "varchar(255)", "comment" => ""],
100 "addr" => ["type" => "varchar(255)", "comment" => ""],
101 "alias" => ["type" => "varchar(255)", "comment" => ""],
102 "pubkey" => ["type" => "text", "comment" => ""],
103 "baseurl" => ["type" => "varchar(255)", "comment" => "baseurl of the ap contact"],
104 "generator" => ["type" => "varchar(255)", "comment" => "Name of the contact's system"],
105 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
108 "PRIMARY" => ["url"],
109 "addr" => ["addr(32)"],
110 "alias" => ["alias(190)"],
111 "url" => ["followers(190)"]
115 "comment" => "file attachments",
117 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "generated index"],
118 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
119 "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "hash"],
120 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "filename of original"],
121 "filetype" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "mimetype"],
122 "filesize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "size in bytes"],
123 "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"],
124 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
125 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
126 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>"],
127 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
128 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
129 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
130 "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
131 "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"],
138 "comment" => "OAuth usage",
140 "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""],
141 "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "relation" => ["clients" => "client_id"],
143 "redirect_uri" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
144 "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
145 "scope" => ["type" => "varchar(250)", "not null" => "1", "default" => "", "comment" => ""],
152 "comment" => "Stores temporary data",
154 "k" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "cache key"],
155 "v" => ["type" => "mediumtext", "comment" => "cached serialized value"],
156 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
157 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache insertion"],
161 "k_expires" => ["k", "expires"],
167 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
168 "challenge" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
169 "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
170 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
171 "type" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
172 "last_update" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
179 "comment" => "OAuth usage",
181 "client_id" => ["type" => "varchar(20)", "not null" => "1", "primary" => "1", "comment" => ""],
182 "pw" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => ""],
183 "redirect_uri" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
184 "name" => ["type" => "text", "comment" => ""],
185 "icon" => ["type" => "text", "comment" => ""],
186 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
189 "PRIMARY" => ["client_id"],
193 "comment" => "main configuration storage",
195 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
196 "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
197 "k" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
198 "v" => ["type" => "mediumtext", "comment" => ""],
202 "cat_k" => ["UNIQUE", "cat", "k"],
206 "comment" => "contact table",
208 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
209 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
210 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
211 "updated" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Date of last contact update"],
212 "self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if the contact is the user him/her self"],
213 "remote_self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
214 "rel" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "The kind of the relation between the user and the contact"],
215 "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
216 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network of the contact"],
217 "protocol" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Protocol of the contact"],
218 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"],
219 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"],
220 "location" => ["type" => "varchar(255)", "default" => "", "comment" => ""],
221 "about" => ["type" => "text", "comment" => ""],
222 "keywords" => ["type" => "text", "comment" => "public keywords (interests) of the contact"],
223 "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
224 "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
225 "attag" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
226 "avatar" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
227 "photo" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo of the contact"],
228 "thumb" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (thumb size)"],
229 "micro" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (micro size)"],
230 "site-pubkey" => ["type" => "text", "comment" => ""],
231 "issued-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
232 "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
233 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
234 "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
235 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
236 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
237 "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
238 "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
239 "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
240 "request" => ["type" => "varchar(255)", "comment" => ""],
241 "notify" => ["type" => "varchar(255)", "comment" => ""],
242 "poll" => ["type" => "varchar(255)", "comment" => ""],
243 "confirm" => ["type" => "varchar(255)", "comment" => ""],
244 "poco" => ["type" => "varchar(255)", "comment" => ""],
245 "aes_allow" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
246 "ret-aes" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
247 "usehub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
248 "subhub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
249 "hub-verify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
250 "last-update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last try to update the contact info"],
251 "success_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful contact update"],
252 "failure_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed update"],
253 "name-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
254 "uri-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
255 "avatar-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
256 "term-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
257 "last-item" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "date of the last post"],
258 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
259 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "Node-wide block status"],
260 "block_reason" => ["type" => "text", "comment" => "Node-wide block reason"],
261 "readonly" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "posts of the contact are readonly"],
262 "writable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
263 "forum" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a forum"],
264 "prv" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a private group"],
265 "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
266 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
267 "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
268 "pending" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
269 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact has been deleted"],
270 "rating" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
271 "unsearchable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact prefers to not be searchable"],
272 "sensitive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact posts sensitive content"],
273 "baseurl" => ["type" => "varchar(255)", "default" => "", "comment" => "baseurl of the contact"],
274 "reason" => ["type" => "text", "comment" => ""],
275 "closeness" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "99", "comment" => ""],
276 "info" => ["type" => "mediumtext", "comment" => ""],
277 "profile-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
278 "bdyear" => ["type" => "varchar(4)", "not null" => "1", "default" => "", "comment" => ""],
279 "bd" => ["type" => "date", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""],
280 "notify_new_posts" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
281 "fetch_further_information" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
282 "ffi_keyword_blacklist" => ["type" => "text", "comment" => ""],
286 "uid_name" => ["uid", "name(190)"],
287 "self_uid" => ["self", "uid"],
288 "alias_uid" => ["alias(32)", "uid"],
289 "pending_uid" => ["pending", "uid"],
290 "blocked_uid" => ["blocked", "uid"],
291 "uid_rel_network_poll" => ["uid", "rel", "network", "poll(64)", "archive"],
292 "uid_network_batch" => ["uid", "network", "batch(64)"],
293 "addr_uid" => ["addr(32)", "uid"],
294 "nurl_uid" => ["nurl(32)", "uid"],
295 "nick_uid" => ["nick(32)", "uid"],
296 "dfrn-id" => ["dfrn-id(64)"],
297 "issued-id" => ["issued-id(64)"],
301 "comment" => "private messages",
303 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
304 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this conversation"],
305 "recips" => ["type" => "text", "comment" => "sender_handle;recipient_handle"],
306 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
307 "creator" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "handle of creator"],
308 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation timestamp"],
309 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "edited timestamp"],
310 "subject" => ["type" => "text", "comment" => "subject of initial message"],
318 "comment" => "Raw data and structure information for messages",
320 "item-uri" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "Original URI of the item - unrelated to the table with the same name"],
321 "reply-to-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "URI to which this item is a reply"],
322 "conversation-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation URI"],
323 "conversation-href" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation link"],
324 "protocol" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "255", "comment" => "The protocol of the item"],
325 "source" => ["type" => "mediumtext", "comment" => "Original source"],
326 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Receiving date"],
329 "PRIMARY" => ["item-uri"],
330 "conversation-uri" => ["conversation-uri"],
331 "received" => ["received"],
334 "diaspora-interaction" => [
335 "comment" => "Signed Diaspora Interaction",
337 "uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
338 "interaction" => ["type" => "mediumtext", "comment" => "The Diaspora interaction"]
341 "PRIMARY" => ["uri-id"]
345 "comment" => "Events",
347 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
348 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
349 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
350 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact_id (ID of the contact in contact table)"],
351 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
352 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
353 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
354 "start" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event start time"],
355 "finish" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event end time"],
356 "summary" => ["type" => "text", "comment" => "short description or title of the event"],
357 "desc" => ["type" => "text", "comment" => "event description"],
358 "location" => ["type" => "text", "comment" => "event location"],
359 "type" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => "event or birthday"],
360 "nofinish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if event does have no end this is 1"],
361 "adjust" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "adjust to timezone of the recipient (0 or 1)"],
362 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "0 or 1"],
363 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
364 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
365 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
366 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
370 "uid_start" => ["uid", "start"],
374 "comment" => "Diaspora compatible contacts - used in the Diaspora implementation",
376 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
377 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "unique id"],
378 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
379 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
380 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
381 "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
382 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
383 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
384 "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
385 "notify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
386 "poll" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
387 "confirm" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
388 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
389 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
390 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
391 "pubkey" => ["type" => "text", "comment" => ""],
392 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
396 "addr" => ["addr(32)"],
397 "url" => ["UNIQUE", "url(190)"],
401 "comment" => "friend suggestion stuff",
403 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
404 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
405 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
406 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
407 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
408 "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
409 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
410 "note" => ["type" => "text", "comment" => ""],
411 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
418 "comment" => "contacts ignored by friend suggestions",
420 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
421 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Local User id"],
422 "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => "gcontact.id of ignored contact"],
431 "comment" => "global contacts",
433 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
434 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"],
435 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"],
436 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the contacts profile page"],
437 "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
438 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the profile photo"],
439 "connect" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
440 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
441 "updated" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
442 "last_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
443 "last_failure" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
444 "archive_date" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
445 "archived" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
446 "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
447 "about" => ["type" => "text", "comment" => ""],
448 "keywords" => ["type" => "text", "comment" => "puplic keywords (interests)"],
449 "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
450 "birthday" => ["type" => "varchar(32)", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""],
451 "community" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if contact is forum account"],
452 "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "-1", "comment" => ""],
453 "hide" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = should be hidden from search"],
454 "nsfw" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = contact posts nsfw content"],
455 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "social network protocol"],
456 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
457 "notify" => ["type" => "varchar(255)", "comment" => ""],
458 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
459 "generation" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
460 "server_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "baseurl of the contacts server"],
464 "nurl" => ["UNIQUE", "nurl(190)"],
465 "name" => ["name(64)"],
466 "nick" => ["nick(32)"],
467 "addr" => ["addr(64)"],
468 "hide_network_updated" => ["hide", "network", "updated"],
469 "updated" => ["updated"],
473 "comment" => "'friends of friends' linkages derived from poco",
475 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
476 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
477 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
478 "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
479 "zcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
480 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
484 "cid_uid_gcid_zcid" => ["UNIQUE", "cid", "uid", "gcid", "zcid"],
489 "comment" => "privacy groups, group info",
491 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
492 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
493 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the member list is not private"],
494 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the group has been deleted"],
495 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "human readable name of group"],
503 "comment" => "privacy groups, member info",
505 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
506 "gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["group" => "id"], "comment" => "groups.id of the associated group"],
507 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id of the member assigned to the associated group"],
511 "contactid" => ["contact-id"],
512 "gid_contactid" => ["UNIQUE", "gid", "contact-id"],
516 "comment" => "Global servers",
518 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
519 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
520 "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
521 "version" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
522 "site_name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
523 "info" => ["type" => "text", "comment" => ""],
524 "register_policy" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
525 "registered-users" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Number of registered users"],
526 "poco" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
527 "noscrape" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
528 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
529 "platform" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
530 "relay-subscribe" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Has the server subscribed to the relay system"],
531 "relay-scope" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => "The scope of messages that the server wants to get"],
532 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
533 "last_poco_query" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
534 "last_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
535 "last_failure" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
539 "nurl" => ["UNIQUE", "nurl(190)"],
543 "comment" => "Tags that the server has subscribed",
545 "gserver-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gserver" => "id"], "primary" => "1",
546 "comment" => "The id of the gserver"],
547 "tag" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "primary" => "1", "comment" => "Tag that the server has subscribed"],
550 "PRIMARY" => ["gserver-id", "tag"],
555 "comment" => "addon hook registry",
557 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
558 "hook" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => "name of hook"],
559 "file" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "relative filename of hook handler"],
560 "function" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "function name of hook handler"],
561 "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"],
565 "hook_file_function" => ["UNIQUE", "hook", "file", "function"],
569 "comment" => "Status of ActivityPub inboxes",
571 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URL of the inbox"],
572 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date of this entry"],
573 "success" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful delivery"],
574 "failure" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed delivery"],
575 "previous" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Previous delivery date"],
576 "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the inbox archived?"],
577 "shared" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is it a shared inbox?"]
586 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
587 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
588 "fid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["fcontact" => "id"], "comment" => ""],
589 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
590 "knowyou" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
591 "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
592 "note" => ["type" => "text", "comment" => ""],
593 "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
594 "datetime" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
595 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
596 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
603 "comment" => "Structure for all posts",
605 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
606 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this item"],
607 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
608 "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
609 "uri-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
610 "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"],
611 "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "uri of the parent to this item"],
612 "parent-uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the parent uri"],
613 "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"],
614 "thr-parent-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"],
615 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation timestamp."],
616 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last edit (default is created)"],
617 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last comment/reply to this item"],
618 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime"],
619 "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"],
620 "gravity" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
621 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network from where the item comes from"],
622 "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"],
623 "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"],
624 "icid" => ["type" => "int unsigned", "relation" => ["item-content" => "id"], "comment" => "Id of the item-content table entry that contains the whole item content"],
625 "iaid" => ["type" => "int unsigned", "relation" => ["item-activity" => "id"], "comment" => "Id of the item-activity table entry that contains the activity data"],
626 "extid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
627 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"],
628 "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
629 "private" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "distribution is restricted"],
630 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
631 "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
632 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been deleted"],
633 // User specific fields. Eventually they will move to user-item
634 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
635 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
636 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "This item was posted to the wall of uid"],
637 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item originated at this site"],
638 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
639 "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been favourited"],
640 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "item has not been seen"],
641 "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "The owner of this item was mentioned in it"],
642 "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
643 "psid" => ["type" => "int unsigned", "relation" => ["permissionset" => "id"], "comment" => "ID of the permission set of this post"],
644 // It has to be decided whether these fields belong to the user or the structure
645 "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"],
646 "event-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["event" => "id"], "comment" => "Used to link to the event.id"],
647 // Could possibly be replaced by the "attach" table?
648 "attach" => ["type" => "mediumtext", "comment" => "JSON structure representing attachments to this item"],
649 // Deprecated fields. Will be removed in upcoming versions
650 "allow_cid" => ["type" => "mediumtext", "comment" => "Deprecated"],
651 "allow_gid" => ["type" => "mediumtext", "comment" => "Deprecated"],
652 "deny_cid" => ["type" => "mediumtext", "comment" => "Deprecated"],
653 "deny_gid" => ["type" => "mediumtext", "comment" => "Deprecated"],
654 "postopts" => ["type" => "text", "comment" => "Deprecated"],
655 "inform" => ["type" => "mediumtext", "comment" => "Deprecated"],
656 "type" => ["type" => "varchar(20)", "comment" => "Deprecated"],
657 "bookmark" => ["type" => "boolean", "comment" => "Deprecated"],
658 "file" => ["type" => "mediumtext", "comment" => "Deprecated"],
659 "location" => ["type" => "varchar(255)", "comment" => "Deprecated"],
660 "coord" => ["type" => "varchar(255)", "comment" => "Deprecated"],
661 "tag" => ["type" => "mediumtext", "comment" => "Deprecated"],
662 "plink" => ["type" => "varchar(255)", "comment" => "Deprecated"],
663 "title" => ["type" => "varchar(255)", "comment" => "Deprecated"],
664 "content-warning" => ["type" => "varchar(255)", "comment" => "Deprecated"],
665 "body" => ["type" => "mediumtext", "comment" => "Deprecated"],
666 "app" => ["type" => "varchar(255)", "comment" => "Deprecated"],
667 "verb" => ["type" => "varchar(100)", "comment" => "Deprecated"],
668 "object-type" => ["type" => "varchar(100)", "comment" => "Deprecated"],
669 "object" => ["type" => "text", "comment" => "Deprecated"],
670 "target-type" => ["type" => "varchar(100)", "comment" => "Deprecated"],
671 "target" => ["type" => "text", "comment" => "Deprecated"],
672 "author-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
673 "author-link" => ["type" => "varchar(255)", "comment" => "Deprecated"],
674 "author-avatar" => ["type" => "varchar(255)", "comment" => "Deprecated"],
675 "owner-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
676 "owner-link" => ["type" => "varchar(255)", "comment" => "Deprecated"],
677 "owner-avatar" => ["type" => "varchar(255)", "comment" => "Deprecated"],
678 "rendered-hash" => ["type" => "varchar(32)", "comment" => "Deprecated"],
679 "rendered-html" => ["type" => "mediumtext", "comment" => "Deprecated"],
683 "guid" => ["guid(191)"],
684 "uri" => ["uri(191)"],
685 "parent" => ["parent"],
686 "parent-uri" => ["parent-uri(191)"],
687 "extid" => ["extid(191)"],
688 "uid_id" => ["uid", "id"],
689 "uid_contactid_id" => ["uid", "contact-id", "id"],
690 "uid_received" => ["uid", "received"],
691 "uid_commented" => ["uid", "commented"],
692 "uid_unseen_contactid" => ["uid", "unseen", "contact-id"],
693 "uid_network_received" => ["uid", "network", "received"],
694 "uid_network_commented" => ["uid", "network", "commented"],
695 "uid_thrparent" => ["uid", "thr-parent(190)"],
696 "uid_parenturi" => ["uid", "parent-uri(190)"],
697 "uid_contactid_received" => ["uid", "contact-id", "received"],
698 "authorid_received" => ["author-id", "received"],
699 "ownerid" => ["owner-id"],
700 "contact-id" => ["contact-id"],
701 "uid_uri" => ["uid", "uri(190)"],
702 "resource-id" => ["resource-id"],
703 "deleted_changed" => ["deleted", "changed"],
704 "uid_wall_changed" => ["uid", "wall", "changed"],
705 "uid_eventid" => ["uid", "event-id"],
708 "psid_wall" => ["psid", "wall"],
712 "comment" => "Activities for items",
714 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
715 "uri" => ["type" => "varchar(255)", "comment" => ""],
716 "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
717 "uri-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
718 "activity" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""]
722 "uri-hash" => ["UNIQUE", "uri-hash"],
723 "uri" => ["uri(191)"],
724 "uri-id" => ["uri-id"]
728 "comment" => "Content for all posts",
730 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
731 "uri" => ["type" => "varchar(255)", "comment" => ""],
732 "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
733 "uri-plink-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
734 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "item title"],
735 "content-warning" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
736 "body" => ["type" => "mediumtext", "comment" => "item body content"],
737 "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "text location where this item originated"],
738 "coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "longitude/latitude pair representing location where this item originated"],
739 "language" => ["type" => "text", "comment" => "Language information about this post"],
740 "app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "application which generated this item"],
741 "rendered-hash" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
742 "rendered-html" => ["type" => "mediumtext", "comment" => "item.body converted to html"],
743 "object-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams object type"],
744 "object" => ["type" => "text", "comment" => "JSON encoded object structure unless it is an implied object (normal post)"],
745 "target-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams target type if applicable (URI)"],
746 "target" => ["type" => "text", "comment" => "JSON encoded target structure if used"],
747 "plink" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "permalink or URL to a displayable copy of the message at its source"],
748 "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams verb"]
752 "uri-plink-hash" => ["UNIQUE", "uri-plink-hash"],
753 "uri" => ["uri(191)"],
754 "plink" => ["plink(191)"],
755 "uri-id" => ["uri-id"]
758 "item-delivery-data" => [
759 "comment" => "Delivery data for items",
761 "iid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["item" => "id"], "comment" => "Item id"],
762 "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"],
763 "inform" => ["type" => "mediumtext", "comment" => "Additional receivers of the linked item"],
764 "queue_count" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Initial number of delivery recipients, used as item.delivery_queue_count"],
765 "queue_done" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries, used as item.delivery_queue_done"],
766 "queue_failed" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of unsuccessful deliveries, used as item.delivery_queue_failed"],
767 "activitypub" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via ActivityPub"],
768 "dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via DFRN"],
769 "legacy_dfrn" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via legacy DFRN"],
770 "diaspora" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via Diaspora"],
771 "ostatus" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries via OStatus"],
774 "PRIMARY" => ["iid"],
778 "comment" => "URI and GUID for items",
780 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
781 "uri" => ["type" => "varbinary(255)", "not null" => "1", "comment" => "URI of an item"],
782 "guid" => ["type" => "varbinary(255)", "comment" => "A unique identifier for an item"]
786 "uri" => ["UNIQUE", "uri"],
793 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
794 "name" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => ""],
795 "locked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
796 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process ID"],
797 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
801 "name_expires" => ["name", "expires"]
805 "comment" => "private messages",
807 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
808 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
809 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this private message"],
810 "from-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "name of the sender"],
811 "from-photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "contact photo link of the sender"],
812 "from-url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "profile linke of the sender"],
813 "contact-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "relation" => ["contact" => "id"], "comment" => "contact.id"],
814 "convid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["conv" => "id"], "comment" => "conv.id"],
815 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
816 "body" => ["type" => "mediumtext", "comment" => ""],
817 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if message visited it is 1"],
818 "reply" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
819 "replied" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
820 "unknown" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if sender not in the contact table this is 1"],
821 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
822 "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
823 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time of the private message"],
827 "uid_seen" => ["uid", "seen"],
828 "convid" => ["convid"],
829 "uri" => ["uri(64)"],
830 "parent-uri" => ["parent-uri(64)"],
831 "contactid" => ["contact-id(32)"],
835 "comment" => "Mail account data for fetching mails",
837 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
838 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
839 "server" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
840 "port" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
841 "ssltype" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
842 "mailbox" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
843 "user" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
844 "pass" => ["type" => "text", "comment" => ""],
845 "reply_to" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
846 "action" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
847 "movetofolder" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
848 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
849 "last_check" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
856 "comment" => "table of accounts that can manage each other",
858 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
859 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
860 "mid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
864 "uid_mid" => ["UNIQUE", "uid", "mid"],
868 "comment" => "notifications",
870 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
871 "type" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
872 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
873 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
874 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
875 "date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
876 "msg" => ["type" => "mediumtext", "comment" => ""],
877 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
878 "link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
879 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id"],
880 "parent" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
881 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
882 "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""],
883 "otype" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => ""],
884 "name_cache" => ["type" => "tinytext", "comment" => "Cached bbcode parsing of name"],
885 "msg_cache" => ["type" => "mediumtext", "comment" => "Cached bbcode parsing of msg"]
889 "seen_uid_date" => ["seen", "uid", "date"],
890 "uid_date" => ["uid", "date"],
891 "uid_type_link" => ["uid", "type", "link(190)"],
894 "notify-threads" => [
897 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
898 "notify-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["notify" => "id"], "comment" => ""],
899 "master-parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"],
901 "parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
902 "receiver-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"],
903 "comment" => "User id"],
910 "comment" => "cache for OEmbed queries",
912 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
913 "maxwidth" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "comment" => "Maximum width passed to Oembed"],
914 "content" => ["type" => "mediumtext", "comment" => "OEmbed data of the page"],
915 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
918 "PRIMARY" => ["url", "maxwidth"],
919 "created" => ["created"],
922 "openwebauth-token" => [
923 "comment" => "Store OpenWebAuth token to verify contacts",
925 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
926 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
927 "type" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Verify type"],
928 "token" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A generated token"],
929 "meta" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
930 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
937 "comment" => "cache for 'parse_url' queries",
939 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
940 "guessing" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the 'guessing' mode active?"],
941 "oembed" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the data the result of oembed?"],
942 "content" => ["type" => "mediumtext", "comment" => "page data"],
943 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
946 "PRIMARY" => ["url", "guessing", "oembed"],
947 "created" => ["created"],
951 "comment" => "Storage for participation messages from Diaspora",
953 "iid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["item" => "id"], "comment" => ""],
954 "server" => ["type" => "varchar(60)", "not null" => "1", "primary" => "1", "comment" => ""],
955 "cid" => ["type" => "int unsigned", "not null" => "1", "relation" => ["contact" => "id"], "comment" => ""],
956 "fid" => ["type" => "int unsigned", "not null" => "1", "relation" => ["fcontact" => "id"], "comment" => ""],
959 "PRIMARY" => ["iid", "server"],
965 "comment" => "personal (per user) configuration storage",
967 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
968 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
969 "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
970 "k" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => ""],
971 "v" => ["type" => "mediumtext", "comment" => ""],
975 "uid_cat_k" => ["UNIQUE", "uid", "cat", "k"],
981 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
982 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner id of this permission set"],
983 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
984 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
985 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
986 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
990 "uid_allow_cid_allow_gid_deny_cid_deny_gid" => ["allow_cid(50)", "allow_gid(30)", "deny_cid(50)", "deny_gid(30)"],
994 "comment" => "photo storage",
996 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
997 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
998 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
999 "guid" => ["type" => "char(16)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this photo"],
1000 "resource-id" => ["type" => "char(32)", "not null" => "1", "default" => "", "comment" => ""],
1001 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation date"],
1002 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edited date"],
1003 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1004 "desc" => ["type" => "text", "comment" => ""],
1005 "album" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "The name of the album to which the photo belongs"],
1006 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1007 "type" => ["type" => "varchar(30)", "not null" => "1", "default" => "image/jpeg"],
1008 "height" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1009 "width" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1010 "datasize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1011 "data" => ["type" => "mediumblob", "not null" => "1", "comment" => ""],
1012 "scale" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1013 "profile" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1014 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
1015 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
1016 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
1017 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
1018 "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
1019 "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"],
1020 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
1023 "PRIMARY" => ["id"],
1024 "contactid" => ["contact-id"],
1025 "uid_contactid" => ["uid", "contact-id"],
1026 "uid_profile" => ["uid", "profile"],
1027 "uid_album_scale_created" => ["uid", "album(32)", "scale", "created"],
1028 "uid_album_resource-id_created" => ["uid", "album(32)", "resource-id", "created"],
1029 "resource-id" => ["resource-id"],
1033 "comment" => "Currently unused table for storing poll results",
1035 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
1036 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1037 "q0" => ["type" => "text", "comment" => ""],
1038 "q1" => ["type" => "text", "comment" => ""],
1039 "q2" => ["type" => "text", "comment" => ""],
1040 "q3" => ["type" => "text", "comment" => ""],
1041 "q4" => ["type" => "text", "comment" => ""],
1042 "q5" => ["type" => "text", "comment" => ""],
1043 "q6" => ["type" => "text", "comment" => ""],
1044 "q7" => ["type" => "text", "comment" => ""],
1045 "q8" => ["type" => "text", "comment" => ""],
1046 "q9" => ["type" => "text", "comment" => ""],
1049 "PRIMARY" => ["id"],
1054 "comment" => "data for polls - currently unused",
1056 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1057 "poll_id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["poll" => "id"]],
1058 "choice" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1061 "PRIMARY" => ["id"],
1062 "poll_id" => ["poll_id"],
1066 "comment" => "Currently running system processes",
1068 "pid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "comment" => ""],
1069 "command" => ["type" => "varbinary(32)", "not null" => "1", "default" => "", "comment" => ""],
1070 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1073 "PRIMARY" => ["pid"],
1074 "command" => ["command"],
1078 "comment" => "user profiles data",
1080 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1081 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
1082 "profile-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name of the profile"],
1083 "is-default" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Mark this profile as default profile"],
1084 "hide-friends" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide friend list from viewers of this profile"],
1085 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1086 "pdesc" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Title or description"],
1087 "dob" => ["type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00", "comment" => "Day of birth"],
1088 "address" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1089 "locality" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1090 "region" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1091 "postal-code" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1092 "country-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1093 "hometown" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1094 "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1095 "marital" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1096 "with" => ["type" => "text", "comment" => ""],
1097 "howlong" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1098 "sexual" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1099 "politic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1100 "religion" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1101 "pub_keywords" => ["type" => "text", "comment" => ""],
1102 "prv_keywords" => ["type" => "text", "comment" => ""],
1103 "likes" => ["type" => "text", "comment" => ""],
1104 "dislikes" => ["type" => "text", "comment" => ""],
1105 "about" => ["type" => "text", "comment" => ""],
1106 "summary" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1107 "music" => ["type" => "text", "comment" => ""],
1108 "book" => ["type" => "text", "comment" => ""],
1109 "tv" => ["type" => "text", "comment" => ""],
1110 "film" => ["type" => "text", "comment" => ""],
1111 "interest" => ["type" => "text", "comment" => ""],
1112 "romance" => ["type" => "text", "comment" => ""],
1113 "work" => ["type" => "text", "comment" => ""],
1114 "education" => ["type" => "text", "comment" => ""],
1115 "contact" => ["type" => "text", "comment" => ""],
1116 "homepage" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1117 "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1118 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1119 "thumb" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1120 "publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish default profile in local directory"],
1121 "net-publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish profile in global directory"],
1124 "PRIMARY" => ["id"],
1125 "uid_is-default" => ["uid", "is-default"],
1126 "pub_keywords" => ["FULLTEXT", "pub_keywords"],
1129 "profile_check" => [
1130 "comment" => "DFRN remote auth use",
1132 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1133 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1134 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
1135 "dfrn_id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1136 "sec" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1137 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1140 "PRIMARY" => ["id"],
1143 "push_subscriber" => [
1144 "comment" => "Used for OStatus: Contains feed subscribers",
1146 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1147 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1148 "callback_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1149 "topic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1150 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1151 "push" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1152 "last_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last successful trial"],
1153 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1154 "renewed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last subscription renewal"],
1155 "secret" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1158 "PRIMARY" => ["id"],
1159 "next_try" => ["next_try"],
1163 "comment" => "registrations requiring admin approval",
1165 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1166 "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1167 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1168 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1169 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1170 "language" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
1171 "note" => ["type" => "text", "comment" => ""],
1174 "PRIMARY" => ["id"],
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" => "User id"],
1182 "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1185 "PRIMARY" => ["id"],
1190 "comment" => "web session storage",
1192 "id" => ["type" => "bigint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1193 "sid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
1194 "data" => ["type" => "text", "comment" => ""],
1195 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1198 "PRIMARY" => ["id"],
1199 "sid" => ["sid(64)"],
1200 "expire" => ["expire"],
1204 "comment" => "Diaspora signatures",
1206 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1207 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id"],
1208 "signed_text" => ["type" => "mediumtext", "comment" => ""],
1209 "signature" => ["type" => "text", "comment" => ""],
1210 "signer" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1213 "PRIMARY" => ["id"],
1214 "iid" => ["UNIQUE", "iid"],
1218 "comment" => "item taxonomy (categories, tags, etc.) table",
1220 "tid" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
1221 "oid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
1222 "otype" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1223 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1224 "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1225 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1226 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1227 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1228 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1229 "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1230 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1233 "PRIMARY" => ["tid"],
1234 "term_type" => ["term(64)", "type"],
1235 "oid_otype_type_term" => ["oid", "otype", "type", "term(32)"],
1236 "uid_otype_type_term_global_created" => ["uid", "otype", "type", "term(32)", "global", "created"],
1237 "uid_otype_type_url" => ["uid", "otype", "type", "url(64)"],
1238 "guid" => ["guid(64)"],
1242 "comment" => "Thread related data",
1244 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"],
1245 "comment" => "sequential ID"],
1246 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1247 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
1248 "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item owner"],
1249 "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item author"],
1250 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1251 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1252 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1253 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1254 "changed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1255 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1256 "private" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1257 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1258 "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1259 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1260 "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1261 "ignored" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1262 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"],
1263 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
1264 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1265 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1266 "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1267 "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1268 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
1269 "bookmark" => ["type" => "boolean", "comment" => ""],
1272 "PRIMARY" => ["iid"],
1273 "uid_network_commented" => ["uid", "network", "commented"],
1274 "uid_network_received" => ["uid", "network", "received"],
1275 "uid_contactid_commented" => ["uid", "contact-id", "commented"],
1276 "uid_contactid_received" => ["uid", "contact-id", "received"],
1277 "contactid" => ["contact-id"],
1278 "ownerid" => ["owner-id"],
1279 "authorid" => ["author-id"],
1280 "uid_received" => ["uid", "received"],
1281 "uid_commented" => ["uid", "commented"],
1282 "uid_wall_received" => ["uid", "wall", "received"],
1283 "private_wall_origin_commented" => ["private", "wall", "origin", "commented"],
1287 "comment" => "OAuth usage",
1289 "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""],
1290 "secret" => ["type" => "text", "comment" => ""],
1291 "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "relation" => ["clients" => "client_id"]],
1292 "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
1293 "scope" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
1294 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1297 "PRIMARY" => ["id"],
1301 "comment" => "The local users",
1303 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1304 "parent-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"],
1305 "comment" => "The parent user that has full control about this user"],
1306 "guid" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this user"],
1307 "username" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this user is known by"],
1308 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "encrypted password"],
1309 "legacy_password" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the password hash double-hashed?"],
1310 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "nick- and user name"],
1311 "email" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "the users email address"],
1312 "openid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1313 "timezone" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => "PHP-legal timezone"],
1314 "language" => ["type" => "varchar(32)", "not null" => "1", "default" => "en", "comment" => "default language"],
1315 "register_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of registration"],
1316 "login_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last login"],
1317 "default-location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Default for item.location"],
1318 "allow_location" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 allows to display the location"],
1319 "theme" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "user theme preference"],
1320 "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
1321 "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
1322 "spubkey" => ["type" => "text", "comment" => ""],
1323 "sprvkey" => ["type" => "text", "comment" => ""],
1324 "verified" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "user is verified through email"],
1325 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 for user is blocked"],
1326 "blockwall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to post to the profile page of the user"],
1327 "hidewall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide profile details from unkown viewers"],
1328 "blocktags" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to tag the post of this user"],
1329 "unkmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Permit unknown people to send private mails to this user"],
1330 "cntunkmail" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
1331 "notify-flags" => ["type" => "smallint unsigned", "not null" => "1", "default" => "65535", "comment" => "email notification options"],
1332 "page-flags" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "page/profile type"],
1333 "account-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1334 "prvnets" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1335 "pwdreset" => ["type" => "varchar(255)", "comment" => "Password reset request token"],
1336 "pwdreset_time" => ["type" => "datetime", "comment" => "Timestamp of the last password reset request"],
1337 "maxreq" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
1338 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1339 "account_removed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if 1 the account is removed"],
1340 "account_expired" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1341 "account_expires_on" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp when account expires and will be deleted"],
1342 "expire_notification_sent" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last warning of account expiration"],
1343 "def_gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1344 "allow_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1345 "allow_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1346 "deny_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1347 "deny_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1348 "openidserver" => ["type" => "text", "comment" => ""],
1351 "PRIMARY" => ["uid"],
1352 "nickname" => ["nickname(32)"],
1356 "comment" => "Deleted usernames",
1358 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1359 "username" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
1362 "PRIMARY" => ["id"],
1363 "username" => ["username(32)"],
1367 "comment" => "User specific public contact data",
1369 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["contact" => "id"], "comment" => "Contact id of the linked public contact"],
1370 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
1371 "blocked" => ["type" => "boolean", "comment" => "Contact is completely blocked for this user"],
1372 "ignored" => ["type" => "boolean", "comment" => "Posts from this contact are ignored"],
1373 "collapsed" => ["type" => "boolean", "comment" => "Posts from this contact are collapsed"]
1376 "PRIMARY" => ["uid", "cid"]
1380 "comment" => "User specific item data",
1382 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"], "comment" => "Item id"],
1383 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
1384 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide an item from the user"],
1385 "ignored" => ["type" => "boolean", "comment" => "Ignore this thread if set"],
1386 "pinned" => ["type" => "boolean", "comment" => "The item is pinned on the profile page"]
1389 "PRIMARY" => ["uid", "iid"],
1390 "uid_pinned" => ["uid", "pinned"]
1394 "comment" => "Inter process communication between the frontend and the worker",
1396 "key" => ["type" => "int", "not null" => "1", "primary" => "1", "comment" => ""],
1397 "jobs" => ["type" => "boolean", "comment" => "Flag for outstanding jobs"],
1400 "PRIMARY" => ["key"],
1402 "engine" => "MEMORY",
1405 "comment" => "Background tasks queue entries",
1407 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented worker task id"],
1408 "parameter" => ["type" => "mediumtext", "comment" => "Task command"],
1409 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Task priority"],
1410 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date"],
1411 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process id of the worker"],
1412 "executed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Execution date"],
1413 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1414 "retrial" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1415 "done" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marked 1 when the task was done - will be deleted later"],
1418 "PRIMARY" => ["id"],
1419 "done_parameter" => ["done", "parameter(64)"],
1420 "done_executed" => ["done", "executed"],
1421 "done_priority_created" => ["done", "priority", "created"],
1422 "done_priority_next_try" => ["done", "priority", "next_try"],
1423 "done_pid_next_try" => ["done", "pid", "next_try"],
1424 "done_pid_priority_created" => ["done", "pid", "priority", "created"]
1428 "comment" => "Data stored by Database storage backend",
1430 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented image data id"],
1431 "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"]