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', 1311);
42 "comment" => "registered addons",
44 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
45 "name" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "addon base (file)name"],
46 "version" => ["type" => "varchar(50)", "not null" => "1", "default" => "", "comment" => "currently unused"],
47 "installed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently always 1"],
48 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "currently unused"],
49 "timestamp" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "file timestamp to check for reloads"],
50 "plugin_admin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = has admin config, 0 = has no admin config"],
54 "name" => ["UNIQUE", "name"],
58 "comment" => "ActivityPub compatible contacts - used in the ActivityPub implementation",
60 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URL of the contact"],
61 "uuid" => ["type" => "varchar(255)", "comment" => ""],
62 "type" => ["type" => "varchar(20)", "not null" => "1", "comment" => ""],
63 "following" => ["type" => "varchar(255)", "comment" => ""],
64 "followers" => ["type" => "varchar(255)", "comment" => ""],
65 "inbox" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
66 "outbox" => ["type" => "varchar(255)", "comment" => ""],
67 "sharedinbox" => ["type" => "varchar(255)", "comment" => ""],
68 "manually-approve" => ["type" => "boolean", "comment" => ""],
69 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
70 "name" => ["type" => "varchar(255)", "comment" => ""],
71 "about" => ["type" => "text", "comment" => ""],
72 "photo" => ["type" => "varchar(255)", "comment" => ""],
73 "addr" => ["type" => "varchar(255)", "comment" => ""],
74 "alias" => ["type" => "varchar(255)", "comment" => ""],
75 "pubkey" => ["type" => "text", "comment" => ""],
76 "baseurl" => ["type" => "varchar(255)", "comment" => "baseurl of the ap contact"],
77 "generator" => ["type" => "varchar(255)", "comment" => "Name of the contact's system"],
78 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
82 "addr" => ["addr(32)"],
83 "alias" => ["alias(190)"],
84 "url" => ["followers(190)"]
88 "comment" => "file attachments",
90 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "generated index"],
91 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
92 "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "hash"],
93 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "filename of original"],
94 "filetype" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "mimetype"],
95 "filesize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "size in bytes"],
96 "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"],
97 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
98 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
99 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>"],
100 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
101 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
102 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
103 "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
104 "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"],
111 "comment" => "OAuth usage",
113 "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""],
114 "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "relation" => ["clients" => "client_id"],
116 "redirect_uri" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
117 "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
118 "scope" => ["type" => "varchar(250)", "not null" => "1", "default" => "", "comment" => ""],
125 "comment" => "Stores temporary data",
127 "k" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "cache key"],
128 "v" => ["type" => "mediumtext", "comment" => "cached serialized value"],
129 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
130 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache insertion"],
134 "k_expires" => ["k", "expires"],
140 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
141 "challenge" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
142 "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
143 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
144 "type" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
145 "last_update" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
152 "comment" => "OAuth usage",
154 "client_id" => ["type" => "varchar(20)", "not null" => "1", "primary" => "1", "comment" => ""],
155 "pw" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => ""],
156 "redirect_uri" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
157 "name" => ["type" => "text", "comment" => ""],
158 "icon" => ["type" => "text", "comment" => ""],
159 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
162 "PRIMARY" => ["client_id"],
166 "comment" => "main configuration storage",
168 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
169 "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
170 "k" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
171 "v" => ["type" => "mediumtext", "comment" => ""],
175 "cat_k" => ["UNIQUE", "cat", "k"],
179 "comment" => "contact table",
181 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
182 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
183 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
184 "updated" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => "Date of last contact update"],
185 "self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if the contact is the user him/her self"],
186 "remote_self" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
187 "rel" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "The kind of the relation between the user and the contact"],
188 "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
189 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network of the contact"],
190 "protocol" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Protocol of the contact"],
191 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"],
192 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"],
193 "location" => ["type" => "varchar(255)", "default" => "", "comment" => ""],
194 "about" => ["type" => "text", "comment" => ""],
195 "keywords" => ["type" => "text", "comment" => "public keywords (interests) of the contact"],
196 "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
197 "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
198 "attag" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
199 "avatar" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
200 "photo" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo of the contact"],
201 "thumb" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (thumb size)"],
202 "micro" => ["type" => "varchar(255)", "default" => "", "comment" => "Link to the profile photo (micro size)"],
203 "site-pubkey" => ["type" => "text", "comment" => ""],
204 "issued-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
205 "dfrn-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
206 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
207 "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
208 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
209 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
210 "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
211 "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
212 "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
213 "request" => ["type" => "varchar(255)", "comment" => ""],
214 "notify" => ["type" => "varchar(255)", "comment" => ""],
215 "poll" => ["type" => "varchar(255)", "comment" => ""],
216 "confirm" => ["type" => "varchar(255)", "comment" => ""],
217 "poco" => ["type" => "varchar(255)", "comment" => ""],
218 "aes_allow" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
219 "ret-aes" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
220 "usehub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
221 "subhub" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
222 "hub-verify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
223 "last-update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last try to update the contact info"],
224 "success_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful contact update"],
225 "failure_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed update"],
226 "name-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
227 "uri-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
228 "avatar-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
229 "term-date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
230 "last-item" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "date of the last post"],
231 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
232 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
233 "readonly" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "posts of the contact are readonly"],
234 "writable" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
235 "forum" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a forum"],
236 "prv" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "contact is a private group"],
237 "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
238 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
239 "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
240 "pending" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
241 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Contact has been deleted"],
242 "rating" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
243 "reason" => ["type" => "text", "comment" => ""],
244 "closeness" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "99", "comment" => ""],
245 "info" => ["type" => "mediumtext", "comment" => ""],
246 "profile-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
247 "bdyear" => ["type" => "varchar(4)", "not null" => "1", "default" => "", "comment" => ""],
248 "bd" => ["type" => "date", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""],
249 "notify_new_posts" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
250 "fetch_further_information" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
251 "ffi_keyword_blacklist" => ["type" => "text", "comment" => ""],
255 "uid_name" => ["uid", "name(190)"],
256 "self_uid" => ["self", "uid"],
257 "alias_uid" => ["alias(32)", "uid"],
258 "pending_uid" => ["pending", "uid"],
259 "blocked_uid" => ["blocked", "uid"],
260 "uid_rel_network_poll" => ["uid", "rel", "network", "poll(64)", "archive"],
261 "uid_network_batch" => ["uid", "network", "batch(64)"],
262 "addr_uid" => ["addr(32)", "uid"],
263 "nurl_uid" => ["nurl(32)", "uid"],
264 "nick_uid" => ["nick(32)", "uid"],
265 "dfrn-id" => ["dfrn-id(64)"],
266 "issued-id" => ["issued-id(64)"],
270 "comment" => "private messages",
272 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
273 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this conversation"],
274 "recips" => ["type" => "text", "comment" => "sender_handle;recipient_handle"],
275 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
276 "creator" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "handle of creator"],
277 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation timestamp"],
278 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "edited timestamp"],
279 "subject" => ["type" => "text", "comment" => "subject of initial message"],
287 "comment" => "Raw data and structure information for messages",
289 "item-uri" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "Original URI of the item - unrelated to the table with the same name"],
290 "reply-to-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "URI to which this item is a reply"],
291 "conversation-uri" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation URI"],
292 "conversation-href" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => "GNU Social conversation link"],
293 "protocol" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "255", "comment" => "The protocol of the item"],
294 "source" => ["type" => "mediumtext", "comment" => "Original source"],
295 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Receiving date"],
298 "PRIMARY" => ["item-uri"],
299 "conversation-uri" => ["conversation-uri"],
300 "received" => ["received"],
303 "diaspora-interaction" => [
304 "comment" => "Signed Diaspora Interaction",
306 "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"],
307 "interaction" => ["type" => "mediumtext", "comment" => "The Diaspora interaction"]
310 "PRIMARY" => ["uri-id"]
314 "comment" => "Events",
316 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
317 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
318 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
319 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact_id (ID of the contact in contact table)"],
320 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
321 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time"],
322 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edit time"],
323 "start" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event start time"],
324 "finish" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "event end time"],
325 "summary" => ["type" => "text", "comment" => "short description or title of the event"],
326 "desc" => ["type" => "text", "comment" => "event description"],
327 "location" => ["type" => "text", "comment" => "event location"],
328 "type" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "comment" => "event or birthday"],
329 "nofinish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if event does have no end this is 1"],
330 "adjust" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "adjust to timezone of the recipient (0 or 1)"],
331 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "0 or 1"],
332 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
333 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
334 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
335 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
339 "uid_start" => ["uid", "start"],
343 "comment" => "Diaspora compatible contacts - used in the Diaspora implementation",
345 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
346 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "unique id"],
347 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
348 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
349 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
350 "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
351 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
352 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
353 "batch" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
354 "notify" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
355 "poll" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
356 "confirm" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
357 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
358 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
359 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
360 "pubkey" => ["type" => "text", "comment" => ""],
361 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
365 "addr" => ["addr(32)"],
366 "url" => ["UNIQUE", "url(190)"],
370 "comment" => "friend suggestion stuff",
372 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
373 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
374 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
375 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
376 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
377 "request" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
378 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
379 "note" => ["type" => "text", "comment" => ""],
380 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
387 "comment" => "contacts ignored by friend suggestions",
389 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
390 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Local User id"],
391 "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => "gcontact.id of ignored contact"],
400 "comment" => "global contacts",
402 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
403 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this contact is known by"],
404 "nick" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Nick- and user name of the contact"],
405 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the contacts profile page"],
406 "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
407 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Link to the profile photo"],
408 "connect" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
409 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
410 "updated" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
411 "last_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
412 "last_failure" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
413 "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
414 "about" => ["type" => "text", "comment" => ""],
415 "keywords" => ["type" => "text", "comment" => "puplic keywords (interests)"],
416 "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
417 "birthday" => ["type" => "varchar(32)", "not null" => "1", "default" => DBA::NULL_DATE, "comment" => ""],
418 "community" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 if contact is forum account"],
419 "contact-type" => ["type" => "tinyint", "not null" => "1", "default" => "-1", "comment" => ""],
420 "hide" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = should be hidden from search"],
421 "nsfw" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 = contact posts nsfw content"],
422 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "social network protocol"],
423 "addr" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
424 "notify" => ["type" => "varchar(255)", "comment" => ""],
425 "alias" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
426 "generation" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
427 "server_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "baseurl of the contacts server"],
431 "nurl" => ["UNIQUE", "nurl(190)"],
432 "name" => ["name(64)"],
433 "nick" => ["nick(32)"],
434 "addr" => ["addr(64)"],
435 "hide_network_updated" => ["hide", "network", "updated"],
436 "updated" => ["updated"],
440 "comment" => "'friends of friends' linkages derived from poco",
442 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
443 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
444 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
445 "gcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
446 "zcid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gcontact" => "id"], "comment" => ""],
447 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
451 "cid_uid_gcid_zcid" => ["UNIQUE", "cid", "uid", "gcid", "zcid"],
456 "comment" => "privacy groups, group info",
458 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
459 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
460 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the member list is not private"],
461 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 indicates the group has been deleted"],
462 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "human readable name of group"],
470 "comment" => "privacy groups, member info",
472 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
473 "gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["group" => "id"], "comment" => "groups.id of the associated group"],
474 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id of the member assigned to the associated group"],
478 "contactid" => ["contact-id"],
479 "gid_contactid" => ["UNIQUE", "gid", "contact-id"],
483 "comment" => "Global servers",
485 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
486 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
487 "nurl" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
488 "version" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
489 "site_name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
490 "info" => ["type" => "text", "comment" => ""],
491 "register_policy" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => ""],
492 "registered-users" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Number of registered users"],
493 "poco" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
494 "noscrape" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
495 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
496 "platform" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
497 "relay-subscribe" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Has the server subscribed to the relay system"],
498 "relay-scope" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => "The scope of messages that the server wants to get"],
499 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
500 "last_poco_query" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
501 "last_contact" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
502 "last_failure" => ["type" => "datetime", "default" => DBA::NULL_DATETIME, "comment" => ""],
506 "nurl" => ["UNIQUE", "nurl(190)"],
510 "comment" => "Tags that the server has subscribed",
512 "gserver-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["gserver" => "id"], "primary" => "1",
513 "comment" => "The id of the gserver"],
514 "tag" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "primary" => "1", "comment" => "Tag that the server has subscribed"],
517 "PRIMARY" => ["gserver-id", "tag"],
522 "comment" => "addon hook registry",
524 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
525 "hook" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => "name of hook"],
526 "file" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "relative filename of hook handler"],
527 "function" => ["type" => "varbinary(200)", "not null" => "1", "default" => "", "comment" => "function name of hook handler"],
528 "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"],
532 "hook_file_function" => ["UNIQUE", "hook", "file", "function"],
536 "comment" => "Status of ActivityPub inboxes",
538 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "URL of the inbox"],
539 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date of this entry"],
540 "success" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last successful delivery"],
541 "failure" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of the last failed delivery"],
542 "previous" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Previous delivery date"],
543 "archive" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the inbox archived?"],
544 "shared" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is it a shared inbox?"]
553 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
554 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
555 "fid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["fcontact" => "id"], "comment" => ""],
556 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
557 "knowyou" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
558 "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
559 "note" => ["type" => "text", "comment" => ""],
560 "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
561 "datetime" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
562 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
563 "ignore" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
570 "comment" => "Structure for all posts",
572 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
573 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this item"],
574 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
575 "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
576 "uri-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
577 "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"],
578 "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "uri of the parent to this item"],
579 "parent-uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the parent uri"],
580 "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"],
581 "thr-parent-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table that contains the thread parent uri"],
582 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation timestamp."],
583 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last edit (default is created)"],
584 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last comment/reply to this item"],
585 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime"],
586 "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"],
587 "gravity" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
588 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => "Network from where the item comes from"],
589 "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"],
590 "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"],
591 "icid" => ["type" => "int unsigned", "relation" => ["item-content" => "id"], "comment" => "Id of the item-content table entry that contains the whole item content"],
592 "iaid" => ["type" => "int unsigned", "relation" => ["item-activity" => "id"], "comment" => "Id of the item-activity table entry that contains the activity data"],
593 "extid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
594 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"],
595 "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
596 "private" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "distribution is restricted"],
597 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
598 "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
599 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been deleted"],
600 // User specific fields. Eventually they will move to user-item
601 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner id which owns this copy of the item"],
602 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
603 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "This item was posted to the wall of uid"],
604 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item originated at this site"],
605 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
606 "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "item has been favourited"],
607 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => "item has not been seen"],
608 "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "The owner of this item was mentioned in it"],
609 "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
610 "psid" => ["type" => "int unsigned", "relation" => ["permissionset" => "id"], "comment" => "ID of the permission set of this post"],
611 // It has to be decided whether these fields belong to the user or the structure
612 "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"],
613 "event-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["event" => "id"], "comment" => "Used to link to the event.id"],
614 // Could possibly be replaced by the "attach" table?
615 "attach" => ["type" => "mediumtext", "comment" => "JSON structure representing attachments to this item"],
616 // Deprecated fields. Will be removed in upcoming versions
617 "allow_cid" => ["type" => "mediumtext", "comment" => "Deprecated"],
618 "allow_gid" => ["type" => "mediumtext", "comment" => "Deprecated"],
619 "deny_cid" => ["type" => "mediumtext", "comment" => "Deprecated"],
620 "deny_gid" => ["type" => "mediumtext", "comment" => "Deprecated"],
621 "postopts" => ["type" => "text", "comment" => "Deprecated"],
622 "inform" => ["type" => "mediumtext", "comment" => "Deprecated"],
623 "type" => ["type" => "varchar(20)", "comment" => "Deprecated"],
624 "bookmark" => ["type" => "boolean", "comment" => "Deprecated"],
625 "file" => ["type" => "mediumtext", "comment" => "Deprecated"],
626 "location" => ["type" => "varchar(255)", "comment" => "Deprecated"],
627 "coord" => ["type" => "varchar(255)", "comment" => "Deprecated"],
628 "tag" => ["type" => "mediumtext", "comment" => "Deprecated"],
629 "plink" => ["type" => "varchar(255)", "comment" => "Deprecated"],
630 "title" => ["type" => "varchar(255)", "comment" => "Deprecated"],
631 "content-warning" => ["type" => "varchar(255)", "comment" => "Deprecated"],
632 "body" => ["type" => "mediumtext", "comment" => "Deprecated"],
633 "app" => ["type" => "varchar(255)", "comment" => "Deprecated"],
634 "verb" => ["type" => "varchar(100)", "comment" => "Deprecated"],
635 "object-type" => ["type" => "varchar(100)", "comment" => "Deprecated"],
636 "object" => ["type" => "text", "comment" => "Deprecated"],
637 "target-type" => ["type" => "varchar(100)", "comment" => "Deprecated"],
638 "target" => ["type" => "text", "comment" => "Deprecated"],
639 "author-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
640 "author-link" => ["type" => "varchar(255)", "comment" => "Deprecated"],
641 "author-avatar" => ["type" => "varchar(255)", "comment" => "Deprecated"],
642 "owner-name" => ["type" => "varchar(255)", "comment" => "Deprecated"],
643 "owner-link" => ["type" => "varchar(255)", "comment" => "Deprecated"],
644 "owner-avatar" => ["type" => "varchar(255)", "comment" => "Deprecated"],
645 "rendered-hash" => ["type" => "varchar(32)", "comment" => "Deprecated"],
646 "rendered-html" => ["type" => "mediumtext", "comment" => "Deprecated"],
650 "guid" => ["guid(191)"],
651 "uri" => ["uri(191)"],
652 "parent" => ["parent"],
653 "parent-uri" => ["parent-uri(191)"],
654 "extid" => ["extid(191)"],
655 "uid_id" => ["uid", "id"],
656 "uid_contactid_id" => ["uid", "contact-id", "id"],
657 "uid_created" => ["uid", "created"],
658 "uid_commented" => ["uid", "commented"],
659 "uid_unseen_contactid" => ["uid", "unseen", "contact-id"],
660 "uid_network_received" => ["uid", "network", "received"],
661 "uid_network_commented" => ["uid", "network", "commented"],
662 "uid_thrparent" => ["uid", "thr-parent(190)"],
663 "uid_parenturi" => ["uid", "parent-uri(190)"],
664 "uid_contactid_created" => ["uid", "contact-id", "created"],
665 "authorid_created" => ["author-id", "created"],
666 "ownerid" => ["owner-id"],
667 "contact-id" => ["contact-id"],
668 "uid_uri" => ["uid", "uri(190)"],
669 "resource-id" => ["resource-id"],
670 "deleted_changed" => ["deleted", "changed"],
671 "uid_wall_changed" => ["uid", "wall", "changed"],
672 "uid_eventid" => ["uid", "event-id"],
675 "psid_wall" => ["psid", "wall"],
679 "comment" => "Activities for items",
681 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
682 "uri" => ["type" => "varchar(255)", "comment" => ""],
683 "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
684 "uri-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
685 "activity" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""]
689 "uri-hash" => ["UNIQUE", "uri-hash"],
690 "uri" => ["uri(191)"],
691 "uri-id" => ["uri-id"]
695 "comment" => "Content for all posts",
697 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "relation" => ["thread" => "iid"]],
698 "uri" => ["type" => "varchar(255)", "comment" => ""],
699 "uri-id" => ["type" => "int unsigned", "relation" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
700 "uri-plink-hash" => ["type" => "varchar(80)", "not null" => "1", "default" => "", "comment" => "RIPEMD-128 hash from uri"],
701 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "item title"],
702 "content-warning" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
703 "body" => ["type" => "mediumtext", "comment" => "item body content"],
704 "location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "text location where this item originated"],
705 "coord" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "longitude/latitude pair representing location where this item originated"],
706 "language" => ["type" => "text", "comment" => "Language information about this post"],
707 "app" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "application which generated this item"],
708 "rendered-hash" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
709 "rendered-html" => ["type" => "mediumtext", "comment" => "item.body converted to html"],
710 "object-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams object type"],
711 "object" => ["type" => "text", "comment" => "JSON encoded object structure unless it is an implied object (normal post)"],
712 "target-type" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams target type if applicable (URI)"],
713 "target" => ["type" => "text", "comment" => "JSON encoded target structure if used"],
714 "plink" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "permalink or URL to a displayable copy of the message at its source"],
715 "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => "ActivityStreams verb"]
719 "uri-plink-hash" => ["UNIQUE", "uri-plink-hash"],
720 "uri" => ["uri(191)"],
721 "uri-id" => ["uri-id"]
724 "item-delivery-data" => [
725 "comment" => "Delivery data for items",
727 "iid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["item" => "id"], "comment" => "Item id"],
728 "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"],
729 "inform" => ["type" => "mediumtext", "comment" => "Additional receivers of the linked item"],
730 "queue_count" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Initial number of delivery recipients, used as item.delivery_queue_count"],
731 "queue_done" => ["type" => "mediumint", "not null" => "1", "default" => "0", "comment" => "Number of successful deliveries, used as item.delivery_queue_done"],
734 "PRIMARY" => ["iid"],
738 "comment" => "URI and GUID for items",
740 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1"],
741 "uri" => ["type" => "varbinary(255)", "not null" => "1", "comment" => "URI of an item"],
742 "guid" => ["type" => "varbinary(255)", "comment" => "A unique identifier for an item"]
746 "uri" => ["UNIQUE", "uri"],
753 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
754 "name" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => ""],
755 "locked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
756 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process ID"],
757 "expires" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of cache expiration"],
761 "name_expires" => ["name", "expires"]
765 "comment" => "private messages",
767 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
768 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
769 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this private message"],
770 "from-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "name of the sender"],
771 "from-photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "contact photo link of the sender"],
772 "from-url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "profile linke of the sender"],
773 "contact-id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "relation" => ["contact" => "id"], "comment" => "contact.id"],
774 "convid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["conv" => "id"], "comment" => "conv.id"],
775 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
776 "body" => ["type" => "mediumtext", "comment" => ""],
777 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if message visited it is 1"],
778 "reply" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
779 "replied" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
780 "unknown" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if sender not in the contact table this is 1"],
781 "uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
782 "parent-uri" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
783 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation time of the private message"],
787 "uid_seen" => ["uid", "seen"],
788 "convid" => ["convid"],
789 "uri" => ["uri(64)"],
790 "parent-uri" => ["parent-uri(64)"],
791 "contactid" => ["contact-id(32)"],
795 "comment" => "Mail account data for fetching mails",
797 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
798 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
799 "server" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
800 "port" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
801 "ssltype" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
802 "mailbox" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
803 "user" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
804 "pass" => ["type" => "text", "comment" => ""],
805 "reply_to" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
806 "action" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
807 "movetofolder" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
808 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
809 "last_check" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
816 "comment" => "table of accounts that can manage each other",
818 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
819 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
820 "mid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
824 "uid_mid" => ["UNIQUE", "uid", "mid"],
828 "comment" => "notifications",
830 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
831 "hash" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => ""],
832 "type" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
833 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
834 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
835 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
836 "date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
837 "msg" => ["type" => "mediumtext", "comment" => ""],
838 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
839 "link" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
840 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id"],
841 "parent" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
842 "seen" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
843 "verb" => ["type" => "varchar(100)", "not null" => "1", "default" => "", "comment" => ""],
844 "otype" => ["type" => "varchar(10)", "not null" => "1", "default" => "", "comment" => ""],
845 "name_cache" => ["type" => "tinytext", "comment" => "Cached bbcode parsing of name"],
846 "msg_cache" => ["type" => "mediumtext", "comment" => "Cached bbcode parsing of msg"]
850 "hash_uid" => ["hash", "uid"],
851 "seen_uid_date" => ["seen", "uid", "date"],
852 "uid_date" => ["uid", "date"],
853 "uid_type_link" => ["uid", "type", "link(190)"],
856 "notify-threads" => [
859 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
860 "notify-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["notify" => "id"], "comment" => ""],
861 "master-parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"],
863 "parent-item" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
864 "receiver-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"],
865 "comment" => "User id"],
872 "comment" => "cache for OEmbed queries",
874 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
875 "maxwidth" => ["type" => "mediumint unsigned", "not null" => "1", "primary" => "1", "comment" => "Maximum width passed to Oembed"],
876 "content" => ["type" => "mediumtext", "comment" => "OEmbed data of the page"],
877 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
880 "PRIMARY" => ["url", "maxwidth"],
881 "created" => ["created"],
884 "openwebauth-token" => [
885 "comment" => "Store OpenWebAuth token to verify contacts",
887 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
888 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
889 "type" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => "Verify type"],
890 "token" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "A generated token"],
891 "meta" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
892 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
899 "comment" => "cache for 'parse_url' queries",
901 "url" => ["type" => "varbinary(255)", "not null" => "1", "primary" => "1", "comment" => "page url"],
902 "guessing" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the 'guessing' mode active?"],
903 "oembed" => ["type" => "boolean", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "is the data the result of oembed?"],
904 "content" => ["type" => "mediumtext", "comment" => "page data"],
905 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "datetime of creation"],
908 "PRIMARY" => ["url", "guessing", "oembed"],
909 "created" => ["created"],
913 "comment" => "Storage for participation messages from Diaspora",
915 "iid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "relation" => ["item" => "id"], "comment" => ""],
916 "server" => ["type" => "varchar(60)", "not null" => "1", "primary" => "1", "comment" => ""],
917 "cid" => ["type" => "int unsigned", "not null" => "1", "relation" => ["contact" => "id"], "comment" => ""],
918 "fid" => ["type" => "int unsigned", "not null" => "1", "relation" => ["fcontact" => "id"], "comment" => ""],
921 "PRIMARY" => ["iid", "server"],
927 "comment" => "personal (per user) configuration storage",
929 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
930 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
931 "cat" => ["type" => "varbinary(50)", "not null" => "1", "default" => "", "comment" => ""],
932 "k" => ["type" => "varbinary(100)", "not null" => "1", "default" => "", "comment" => ""],
933 "v" => ["type" => "mediumtext", "comment" => ""],
937 "uid_cat_k" => ["UNIQUE", "uid", "cat", "k"],
943 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
944 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner id of this permission set"],
945 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
946 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
947 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
948 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
952 "uid_allow_cid_allow_gid_deny_cid_deny_gid" => ["allow_cid(50)", "allow_gid(30)", "deny_cid(50)", "deny_gid(30)"],
956 "comment" => "photo storage",
958 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
959 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
960 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
961 "guid" => ["type" => "char(16)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this photo"],
962 "resource-id" => ["type" => "char(32)", "not null" => "1", "default" => "", "comment" => ""],
963 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "creation date"],
964 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "last edited date"],
965 "title" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
966 "desc" => ["type" => "text", "comment" => ""],
967 "album" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "The name of the album to which the photo belongs"],
968 "filename" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
969 "type" => ["type" => "varchar(30)", "not null" => "1", "default" => "image/jpeg"],
970 "height" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
971 "width" => ["type" => "smallint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
972 "datasize" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
973 "data" => ["type" => "mediumblob", "not null" => "1", "comment" => ""],
974 "scale" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
975 "profile" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
976 "allow_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed contact.id '<19><78>'"],
977 "allow_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of allowed groups"],
978 "deny_cid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied contact.id"],
979 "deny_gid" => ["type" => "mediumtext", "comment" => "Access Control - list of denied groups"],
980 "backend-class" => ["type" => "tinytext", "comment" => "Storage backend class"],
981 "backend-ref" => ["type" => "text", "comment" => "Storage backend data reference"],
982 "updated" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""]
986 "contactid" => ["contact-id"],
987 "uid_contactid" => ["uid", "contact-id"],
988 "uid_profile" => ["uid", "profile"],
989 "uid_album_scale_created" => ["uid", "album(32)", "scale", "created"],
990 "uid_album_resource-id_created" => ["uid", "album(32)", "resource-id", "created"],
991 "resource-id" => ["resource-id"],
995 "comment" => "Currently unused table for storing poll results",
997 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
998 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
999 "q0" => ["type" => "text", "comment" => ""],
1000 "q1" => ["type" => "text", "comment" => ""],
1001 "q2" => ["type" => "text", "comment" => ""],
1002 "q3" => ["type" => "text", "comment" => ""],
1003 "q4" => ["type" => "text", "comment" => ""],
1004 "q5" => ["type" => "text", "comment" => ""],
1005 "q6" => ["type" => "text", "comment" => ""],
1006 "q7" => ["type" => "text", "comment" => ""],
1007 "q8" => ["type" => "text", "comment" => ""],
1008 "q9" => ["type" => "text", "comment" => ""],
1011 "PRIMARY" => ["id"],
1016 "comment" => "data for polls - currently unused",
1018 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1019 "poll_id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["poll" => "id"]],
1020 "choice" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1023 "PRIMARY" => ["id"],
1024 "poll_id" => ["poll_id"],
1028 "comment" => "Currently running system processes",
1030 "pid" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "comment" => ""],
1031 "command" => ["type" => "varbinary(32)", "not null" => "1", "default" => "", "comment" => ""],
1032 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1035 "PRIMARY" => ["pid"],
1036 "command" => ["command"],
1040 "comment" => "user profiles data",
1042 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1043 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "Owner User id"],
1044 "profile-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name of the profile"],
1045 "is-default" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Mark this profile as default profile"],
1046 "hide-friends" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide friend list from viewers of this profile"],
1047 "name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1048 "pdesc" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Title or description"],
1049 "dob" => ["type" => "varchar(32)", "not null" => "1", "default" => "0000-00-00", "comment" => "Day of birth"],
1050 "address" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1051 "locality" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1052 "region" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1053 "postal-code" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1054 "country-name" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1055 "hometown" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1056 "gender" => ["type" => "varchar(32)", "not null" => "1", "default" => "", "comment" => ""],
1057 "marital" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1058 "with" => ["type" => "text", "comment" => ""],
1059 "howlong" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1060 "sexual" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1061 "politic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1062 "religion" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1063 "pub_keywords" => ["type" => "text", "comment" => ""],
1064 "prv_keywords" => ["type" => "text", "comment" => ""],
1065 "likes" => ["type" => "text", "comment" => ""],
1066 "dislikes" => ["type" => "text", "comment" => ""],
1067 "about" => ["type" => "text", "comment" => ""],
1068 "summary" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1069 "music" => ["type" => "text", "comment" => ""],
1070 "book" => ["type" => "text", "comment" => ""],
1071 "tv" => ["type" => "text", "comment" => ""],
1072 "film" => ["type" => "text", "comment" => ""],
1073 "interest" => ["type" => "text", "comment" => ""],
1074 "romance" => ["type" => "text", "comment" => ""],
1075 "work" => ["type" => "text", "comment" => ""],
1076 "education" => ["type" => "text", "comment" => ""],
1077 "contact" => ["type" => "text", "comment" => ""],
1078 "homepage" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1079 "xmpp" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1080 "photo" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1081 "thumb" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1082 "publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish default profile in local directory"],
1083 "net-publish" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "publish profile in global directory"],
1086 "PRIMARY" => ["id"],
1087 "uid_is-default" => ["uid", "is-default"],
1088 "pub_keywords" => ["FULLTEXT", "pub_keywords"],
1091 "profile_check" => [
1092 "comment" => "DFRN remote auth use",
1094 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1095 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1096 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "contact.id"],
1097 "dfrn_id" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1098 "sec" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1099 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1102 "PRIMARY" => ["id"],
1105 "push_subscriber" => [
1106 "comment" => "Used for OStatus: Contains feed subscribers",
1108 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1109 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1110 "callback_url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1111 "topic" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1112 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1113 "push" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1114 "last_update" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last successful trial"],
1115 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1116 "renewed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Date of last subscription renewal"],
1117 "secret" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1120 "PRIMARY" => ["id"],
1121 "next_try" => ["next_try"],
1125 "comment" => "registrations requiring admin approval",
1127 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1128 "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1129 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1130 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1131 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1132 "language" => ["type" => "varchar(16)", "not null" => "1", "default" => "", "comment" => ""],
1133 "note" => ["type" => "text", "comment" => ""],
1136 "PRIMARY" => ["id"],
1142 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1143 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1144 "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1147 "PRIMARY" => ["id"],
1152 "comment" => "web session storage",
1154 "id" => ["type" => "bigint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1155 "sid" => ["type" => "varbinary(255)", "not null" => "1", "default" => "", "comment" => ""],
1156 "data" => ["type" => "text", "comment" => ""],
1157 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1160 "PRIMARY" => ["id"],
1161 "sid" => ["sid(64)"],
1162 "expire" => ["expire"],
1166 "comment" => "Diaspora signatures",
1168 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1169 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => "item.id"],
1170 "signed_text" => ["type" => "mediumtext", "comment" => ""],
1171 "signature" => ["type" => "text", "comment" => ""],
1172 "signer" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1175 "PRIMARY" => ["id"],
1176 "iid" => ["UNIQUE", "iid"],
1180 "comment" => "item taxonomy (categories, tags, etc.) table",
1182 "tid" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => ""],
1183 "oid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["item" => "id"], "comment" => ""],
1184 "otype" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1185 "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1186 "term" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1187 "url" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1188 "guid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1189 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1190 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1191 "global" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1192 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1195 "PRIMARY" => ["tid"],
1196 "term_type" => ["term(64)", "type"],
1197 "oid_otype_type_term" => ["oid", "otype", "type", "term(32)"],
1198 "uid_otype_type_term_global_created" => ["uid", "otype", "type", "term(32)", "global", "created"],
1199 "uid_otype_type_url" => ["uid", "otype", "type", "url(64)"],
1200 "guid" => ["guid(64)"],
1204 "comment" => "Thread related data",
1206 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"],
1207 "comment" => "sequential ID"],
1208 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1209 "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => ""],
1210 "owner-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item owner"],
1211 "author-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "relation" => ["contact" => "id"], "comment" => "Item author"],
1212 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1213 "edited" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1214 "commented" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1215 "received" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1216 "changed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""],
1217 "wall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1218 "private" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1219 "pubmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1220 "moderated" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1221 "visible" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1222 "starred" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1223 "ignored" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1224 "post-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Post type (personal note, bookmark, ...)"],
1225 "unseen" => ["type" => "boolean", "not null" => "1", "default" => "1", "comment" => ""],
1226 "deleted" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1227 "origin" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1228 "forum_mode" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1229 "mention" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1230 "network" => ["type" => "char(4)", "not null" => "1", "default" => "", "comment" => ""],
1231 "bookmark" => ["type" => "boolean", "comment" => ""],
1234 "PRIMARY" => ["iid"],
1235 "uid_network_commented" => ["uid", "network", "commented"],
1236 "uid_network_created" => ["uid", "network", "created"],
1237 "uid_contactid_commented" => ["uid", "contact-id", "commented"],
1238 "uid_contactid_created" => ["uid", "contact-id", "created"],
1239 "contactid" => ["contact-id"],
1240 "ownerid" => ["owner-id"],
1241 "authorid" => ["author-id"],
1242 "uid_created" => ["uid", "created"],
1243 "uid_commented" => ["uid", "commented"],
1244 "uid_wall_created" => ["uid", "wall", "created"],
1245 "private_wall_origin_commented" => ["private", "wall", "origin", "commented"],
1249 "comment" => "OAuth usage",
1251 "id" => ["type" => "varchar(40)", "not null" => "1", "primary" => "1", "comment" => ""],
1252 "secret" => ["type" => "text", "comment" => ""],
1253 "client_id" => ["type" => "varchar(20)", "not null" => "1", "default" => "", "relation" => ["clients" => "client_id"]],
1254 "expires" => ["type" => "int", "not null" => "1", "default" => "0", "comment" => ""],
1255 "scope" => ["type" => "varchar(200)", "not null" => "1", "default" => "", "comment" => ""],
1256 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"], "comment" => "User id"],
1259 "PRIMARY" => ["id"],
1263 "comment" => "The local users",
1265 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1266 "parent-uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "relation" => ["user" => "uid"],
1267 "comment" => "The parent user that has full control about this user"],
1268 "guid" => ["type" => "varchar(64)", "not null" => "1", "default" => "", "comment" => "A unique identifier for this user"],
1269 "username" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Name that this user is known by"],
1270 "password" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "encrypted password"],
1271 "legacy_password" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Is the password hash double-hashed?"],
1272 "nickname" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "nick- and user name"],
1273 "email" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "the users email address"],
1274 "openid" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""],
1275 "timezone" => ["type" => "varchar(128)", "not null" => "1", "default" => "", "comment" => "PHP-legal timezone"],
1276 "language" => ["type" => "varchar(32)", "not null" => "1", "default" => "en", "comment" => "default language"],
1277 "register_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of registration"],
1278 "login_date" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last login"],
1279 "default-location" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "Default for item.location"],
1280 "allow_location" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 allows to display the location"],
1281 "theme" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => "user theme preference"],
1282 "pubkey" => ["type" => "text", "comment" => "RSA public key 4096 bit"],
1283 "prvkey" => ["type" => "text", "comment" => "RSA private key 4096 bit"],
1284 "spubkey" => ["type" => "text", "comment" => ""],
1285 "sprvkey" => ["type" => "text", "comment" => ""],
1286 "verified" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "user is verified through email"],
1287 "blocked" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "1 for user is blocked"],
1288 "blockwall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to post to the profile page of the user"],
1289 "hidewall" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Hide profile details from unkown viewers"],
1290 "blocktags" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Prohibit contacts to tag the post of this user"],
1291 "unkmail" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Permit unknown people to send private mails to this user"],
1292 "cntunkmail" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
1293 "notify-flags" => ["type" => "smallint unsigned", "not null" => "1", "default" => "65535", "comment" => "email notification options"],
1294 "page-flags" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "page/profile type"],
1295 "account-type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1296 "prvnets" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1297 "pwdreset" => ["type" => "varchar(255)", "comment" => "Password reset request token"],
1298 "pwdreset_time" => ["type" => "datetime", "comment" => "Timestamp of the last password reset request"],
1299 "maxreq" => ["type" => "int unsigned", "not null" => "1", "default" => "10", "comment" => ""],
1300 "expire" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1301 "account_removed" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "if 1 the account is removed"],
1302 "account_expired" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""],
1303 "account_expires_on" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp when account expires and will be deleted"],
1304 "expire_notification_sent" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "timestamp of last warning of account expiration"],
1305 "def_gid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => ""],
1306 "allow_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1307 "allow_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1308 "deny_cid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1309 "deny_gid" => ["type" => "mediumtext", "comment" => "default permission for this user"],
1310 "openidserver" => ["type" => "text", "comment" => ""],
1313 "PRIMARY" => ["uid"],
1314 "nickname" => ["nickname(32)"],
1318 "comment" => "Deleted usernames",
1320 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "sequential ID"],
1321 "username" => ["type" => "varchar(255)", "not null" => "1", "comment" => ""],
1324 "PRIMARY" => ["id"],
1325 "username" => ["username(32)"],
1329 "comment" => "User specific public contact data",
1331 "cid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["contact" => "id"], "comment" => "Contact id of the linked public contact"],
1332 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
1333 "blocked" => ["type" => "boolean", "comment" => "Contact is completely blocked for this user"],
1334 "ignored" => ["type" => "boolean", "comment" => "Posts from this contact are ignored"],
1335 "collapsed" => ["type" => "boolean", "comment" => "Posts from this contact are collapsed"]
1338 "PRIMARY" => ["uid", "cid"]
1342 "comment" => "User specific item data",
1344 "iid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["item" => "id"], "comment" => "Item id"],
1345 "uid" => ["type" => "mediumint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "relation" => ["user" => "uid"], "comment" => "User id"],
1346 "hidden" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marker to hide an item from the user"],
1347 "ignored" => ["type" => "boolean", "comment" => "Ignore this thread if set"]
1350 "PRIMARY" => ["uid", "iid"]
1354 "comment" => "Inter process communication between the frontend and the worker",
1356 "key" => ["type" => "int", "not null" => "1", "primary" => "1", "comment" => ""],
1357 "jobs" => ["type" => "boolean", "comment" => "Flag for outstanding jobs"],
1360 "PRIMARY" => ["key"],
1362 "engine" => "MEMORY",
1365 "comment" => "Background tasks queue entries",
1367 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented worker task id"],
1368 "parameter" => ["type" => "mediumtext", "comment" => "Task command"],
1369 "priority" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "comment" => "Task priority"],
1370 "created" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Creation date"],
1371 "pid" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "comment" => "Process id of the worker"],
1372 "executed" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Execution date"],
1373 "next_try" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => "Next retrial date"],
1374 "retrial" => ["type" => "tinyint", "not null" => "1", "default" => "0", "comment" => "Retrial counter"],
1375 "done" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "Marked 1 when the task was done - will be deleted later"],
1378 "PRIMARY" => ["id"],
1379 "done_parameter" => ["done", "parameter(64)"],
1380 "done_executed" => ["done", "executed"],
1381 "done_priority_created" => ["done", "priority", "created"],
1382 "done_priority_next_try" => ["done", "priority", "next_try"],
1383 "done_pid_next_try" => ["done", "pid", "next_try"],
1384 "done_pid_priority_created" => ["done", "pid", "priority", "created"]
1388 "comment" => "Data stored by Database storage backend",
1390 "id" => ["type" => "int unsigned", "not null" => "1", "extra" => "auto_increment", "primary" => "1", "comment" => "Auto incremented image data id"],
1391 "data" => ["type" => "longblob", "not null" => "1", "comment" => "file data"]