1 -- ------------------------------------------
2 -- Friendica 2018-05-dev (The Tazmans Flax-lily)
3 -- DB_UPDATE_VERSION 1259
4 -- ------------------------------------------
10 CREATE TABLE IF NOT EXISTS `addon` (
11 `id` int unsigned NOT NULL auto_increment COMMENT '',
12 `name` varchar(50) NOT NULL DEFAULT '' COMMENT '',
13 `version` varchar(50) NOT NULL DEFAULT '' COMMENT '',
14 `installed` boolean NOT NULL DEFAULT '0' COMMENT '',
15 `hidden` boolean NOT NULL DEFAULT '0' COMMENT '',
16 `timestamp` int unsigned NOT NULL DEFAULT 0 COMMENT '',
17 `plugin_admin` boolean NOT NULL DEFAULT '0' COMMENT '',
19 UNIQUE INDEX `name` (`name`)
20 ) DEFAULT COLLATE utf8mb4_general_ci;
25 CREATE TABLE IF NOT EXISTS `attach` (
26 `id` int unsigned NOT NULL auto_increment COMMENT '',
27 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
28 `hash` varchar(64) NOT NULL DEFAULT '' COMMENT '',
29 `filename` varchar(255) NOT NULL DEFAULT '' COMMENT '',
30 `filetype` varchar(64) NOT NULL DEFAULT '' COMMENT '',
31 `filesize` int unsigned NOT NULL DEFAULT 0 COMMENT '',
32 `data` longblob NOT NULL COMMENT '',
33 `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
34 `edited` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
35 `allow_cid` mediumtext COMMENT '',
36 `allow_gid` mediumtext COMMENT '',
37 `deny_cid` mediumtext COMMENT '',
38 `deny_gid` mediumtext COMMENT '',
40 ) DEFAULT COLLATE utf8mb4_general_ci;
45 CREATE TABLE IF NOT EXISTS `auth_codes` (
46 `id` varchar(40) NOT NULL COMMENT '',
47 `client_id` varchar(20) NOT NULL DEFAULT '' COMMENT '',
48 `redirect_uri` varchar(200) NOT NULL DEFAULT '' COMMENT '',
49 `expires` int NOT NULL DEFAULT 0 COMMENT '',
50 `scope` varchar(250) NOT NULL DEFAULT '' COMMENT '',
52 ) DEFAULT COLLATE utf8mb4_general_ci;
57 CREATE TABLE IF NOT EXISTS `cache` (
58 `k` varbinary(255) NOT NULL COMMENT 'cache key',
59 `v` mediumtext COMMENT 'cached serialized value',
60 `expires` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'datetime of cache expiration',
61 `updated` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'datetime of cache insertion',
63 INDEX `k_expires` (`k`,`expires`)
64 ) DEFAULT COLLATE utf8mb4_general_ci;
69 CREATE TABLE IF NOT EXISTS `challenge` (
70 `id` int unsigned NOT NULL auto_increment COMMENT '',
71 `challenge` varchar(255) NOT NULL DEFAULT '' COMMENT '',
72 `dfrn-id` varchar(255) NOT NULL DEFAULT '' COMMENT '',
73 `expire` int unsigned NOT NULL DEFAULT 0 COMMENT '',
74 `type` varchar(255) NOT NULL DEFAULT '' COMMENT '',
75 `last_update` varchar(255) NOT NULL DEFAULT '' COMMENT '',
77 ) DEFAULT COLLATE utf8mb4_general_ci;
82 CREATE TABLE IF NOT EXISTS `clients` (
83 `client_id` varchar(20) NOT NULL COMMENT '',
84 `pw` varchar(20) NOT NULL DEFAULT '' COMMENT '',
85 `redirect_uri` varchar(200) NOT NULL DEFAULT '' COMMENT '',
86 `name` text COMMENT '',
87 `icon` text COMMENT '',
88 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
89 PRIMARY KEY(`client_id`)
90 ) DEFAULT COLLATE utf8mb4_general_ci;
95 CREATE TABLE IF NOT EXISTS `config` (
96 `id` int unsigned NOT NULL auto_increment COMMENT '',
97 `cat` varbinary(50) NOT NULL DEFAULT '' COMMENT '',
98 `k` varbinary(50) NOT NULL DEFAULT '' COMMENT '',
99 `v` mediumtext COMMENT '',
101 UNIQUE INDEX `cat_k` (`cat`,`k`)
102 ) DEFAULT COLLATE utf8mb4_general_ci;
107 CREATE TABLE IF NOT EXISTS `contact` (
108 `id` int unsigned NOT NULL auto_increment COMMENT '',
109 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
110 `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
111 `self` boolean NOT NULL DEFAULT '0' COMMENT '',
112 `remote_self` boolean NOT NULL DEFAULT '0' COMMENT '',
113 `rel` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
114 `duplex` boolean NOT NULL DEFAULT '0' COMMENT '',
115 `network` char(4) NOT NULL DEFAULT '' COMMENT '',
116 `name` varchar(255) NOT NULL DEFAULT '' COMMENT '',
117 `nick` varchar(255) NOT NULL DEFAULT '' COMMENT '',
118 `location` varchar(255) NOT NULL DEFAULT '' COMMENT '',
119 `about` text COMMENT '',
120 `keywords` text COMMENT '',
121 `gender` varchar(32) NOT NULL DEFAULT '' COMMENT '',
122 `xmpp` varchar(255) NOT NULL DEFAULT '' COMMENT '',
123 `attag` varchar(255) NOT NULL DEFAULT '' COMMENT '',
124 `avatar` varchar(255) NOT NULL DEFAULT '' COMMENT '',
125 `photo` varchar(255) DEFAULT '' COMMENT '',
126 `thumb` varchar(255) DEFAULT '' COMMENT '',
127 `micro` varchar(255) DEFAULT '' COMMENT '',
128 `site-pubkey` text COMMENT '',
129 `issued-id` varchar(255) NOT NULL DEFAULT '' COMMENT '',
130 `dfrn-id` varchar(255) NOT NULL DEFAULT '' COMMENT '',
131 `url` varchar(255) NOT NULL DEFAULT '' COMMENT '',
132 `nurl` varchar(255) NOT NULL DEFAULT '' COMMENT '',
133 `addr` varchar(255) NOT NULL DEFAULT '' COMMENT '',
134 `alias` varchar(255) NOT NULL DEFAULT '' COMMENT '',
135 `pubkey` text COMMENT '',
136 `prvkey` text COMMENT '',
137 `batch` varchar(255) NOT NULL DEFAULT '' COMMENT '',
138 `request` varchar(255) COMMENT '',
139 `notify` varchar(255) COMMENT '',
140 `poll` varchar(255) COMMENT '',
141 `confirm` varchar(255) COMMENT '',
142 `poco` varchar(255) COMMENT '',
143 `aes_allow` boolean NOT NULL DEFAULT '0' COMMENT '',
144 `ret-aes` boolean NOT NULL DEFAULT '0' COMMENT '',
145 `usehub` boolean NOT NULL DEFAULT '0' COMMENT '',
146 `subhub` boolean NOT NULL DEFAULT '0' COMMENT '',
147 `hub-verify` varchar(255) NOT NULL DEFAULT '' COMMENT '',
148 `last-update` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
149 `success_update` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
150 `failure_update` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
151 `name-date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
152 `uri-date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
153 `avatar-date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
154 `term-date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
155 `last-item` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
156 `priority` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
157 `blocked` boolean NOT NULL DEFAULT '1' COMMENT '',
158 `readonly` boolean NOT NULL DEFAULT '0' COMMENT '',
159 `writable` boolean NOT NULL DEFAULT '0' COMMENT '',
160 `forum` boolean NOT NULL DEFAULT '0' COMMENT '',
161 `prv` boolean NOT NULL DEFAULT '0' COMMENT '',
162 `contact-type` tinyint NOT NULL DEFAULT 0 COMMENT '',
163 `hidden` boolean NOT NULL DEFAULT '0' COMMENT '',
164 `archive` boolean NOT NULL DEFAULT '0' COMMENT '',
165 `pending` boolean NOT NULL DEFAULT '1' COMMENT '',
166 `rating` tinyint NOT NULL DEFAULT 0 COMMENT '',
167 `reason` text COMMENT '',
168 `closeness` tinyint unsigned NOT NULL DEFAULT 99 COMMENT '',
169 `info` mediumtext COMMENT '',
170 `profile-id` int unsigned NOT NULL DEFAULT 0 COMMENT '',
171 `bdyear` varchar(4) NOT NULL DEFAULT '' COMMENT '',
172 `bd` date NOT NULL DEFAULT '0001-01-01' COMMENT '',
173 `notify_new_posts` boolean NOT NULL DEFAULT '0' COMMENT '',
174 `fetch_further_information` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
175 `ffi_keyword_blacklist` text COMMENT '',
177 INDEX `uid_name` (`uid`,`name`(190)),
178 INDEX `self_uid` (`self`,`uid`),
179 INDEX `alias_uid` (`alias`(32),`uid`),
180 INDEX `pending_uid` (`pending`,`uid`),
181 INDEX `blocked_uid` (`blocked`,`uid`),
182 INDEX `uid_rel_network_poll` (`uid`,`rel`,`network`,`poll`(64),`archive`),
183 INDEX `uid_network_batch` (`uid`,`network`,`batch`(64)),
184 INDEX `addr_uid` (`addr`(32),`uid`),
185 INDEX `nurl_uid` (`nurl`(32),`uid`),
186 INDEX `nick_uid` (`nick`(32),`uid`),
187 INDEX `dfrn-id` (`dfrn-id`(64)),
188 INDEX `issued-id` (`issued-id`(64))
189 ) DEFAULT COLLATE utf8mb4_general_ci;
194 CREATE TABLE IF NOT EXISTS `conv` (
195 `id` int unsigned NOT NULL auto_increment COMMENT '',
196 `guid` varchar(255) NOT NULL DEFAULT '' COMMENT '',
197 `recips` text COMMENT '',
198 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
199 `creator` varchar(255) NOT NULL DEFAULT '' COMMENT '',
200 `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
201 `updated` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
202 `subject` text COMMENT '',
205 ) DEFAULT COLLATE utf8mb4_general_ci;
208 -- TABLE conversation
210 CREATE TABLE IF NOT EXISTS `conversation` (
211 `item-uri` varbinary(255) NOT NULL COMMENT '',
212 `reply-to-uri` varbinary(255) NOT NULL DEFAULT '' COMMENT '',
213 `conversation-uri` varbinary(255) NOT NULL DEFAULT '' COMMENT '',
214 `conversation-href` varbinary(255) NOT NULL DEFAULT '' COMMENT '',
215 `protocol` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
216 `source` mediumtext COMMENT '',
217 `received` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
218 PRIMARY KEY(`item-uri`),
219 INDEX `conversation-uri` (`conversation-uri`),
220 INDEX `received` (`received`)
221 ) DEFAULT COLLATE utf8mb4_general_ci;
226 CREATE TABLE IF NOT EXISTS `event` (
227 `id` int unsigned NOT NULL auto_increment COMMENT '',
228 `guid` varchar(255) NOT NULL DEFAULT '' COMMENT '',
229 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
230 `cid` int unsigned NOT NULL DEFAULT 0 COMMENT '',
231 `uri` varchar(255) NOT NULL DEFAULT '' COMMENT '',
232 `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
233 `edited` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
234 `start` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
235 `finish` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
236 `summary` text COMMENT '',
237 `desc` text COMMENT '',
238 `location` text COMMENT '',
239 `type` varchar(20) NOT NULL DEFAULT '' COMMENT '',
240 `nofinish` boolean NOT NULL DEFAULT '0' COMMENT '',
241 `adjust` boolean NOT NULL DEFAULT '1' COMMENT '',
242 `ignore` boolean NOT NULL DEFAULT '0' COMMENT '',
243 `allow_cid` mediumtext COMMENT '',
244 `allow_gid` mediumtext COMMENT '',
245 `deny_cid` mediumtext COMMENT '',
246 `deny_gid` mediumtext COMMENT '',
248 INDEX `uid_start` (`uid`,`start`)
249 ) DEFAULT COLLATE utf8mb4_general_ci;
254 CREATE TABLE IF NOT EXISTS `fcontact` (
255 `id` int unsigned NOT NULL auto_increment COMMENT '',
256 `guid` varchar(255) NOT NULL DEFAULT '' COMMENT '',
257 `url` varchar(255) NOT NULL DEFAULT '' COMMENT '',
258 `name` varchar(255) NOT NULL DEFAULT '' COMMENT '',
259 `photo` varchar(255) NOT NULL DEFAULT '' COMMENT '',
260 `request` varchar(255) NOT NULL DEFAULT '' COMMENT '',
261 `nick` varchar(255) NOT NULL DEFAULT '' COMMENT '',
262 `addr` varchar(255) NOT NULL DEFAULT '' COMMENT '',
263 `batch` varchar(255) NOT NULL DEFAULT '' COMMENT '',
264 `notify` varchar(255) NOT NULL DEFAULT '' COMMENT '',
265 `poll` varchar(255) NOT NULL DEFAULT '' COMMENT '',
266 `confirm` varchar(255) NOT NULL DEFAULT '' COMMENT '',
267 `priority` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
268 `network` char(4) NOT NULL DEFAULT '' COMMENT '',
269 `alias` varchar(255) NOT NULL DEFAULT '' COMMENT '',
270 `pubkey` text COMMENT '',
271 `updated` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
273 INDEX `addr` (`addr`(32)),
274 UNIQUE INDEX `url` (`url`(190))
275 ) DEFAULT COLLATE utf8mb4_general_ci;
280 CREATE TABLE IF NOT EXISTS `fsuggest` (
281 `id` int unsigned NOT NULL auto_increment COMMENT '',
282 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
283 `cid` int unsigned NOT NULL DEFAULT 0 COMMENT '',
284 `name` varchar(255) NOT NULL DEFAULT '' COMMENT '',
285 `url` varchar(255) NOT NULL DEFAULT '' COMMENT '',
286 `request` varchar(255) NOT NULL DEFAULT '' COMMENT '',
287 `photo` varchar(255) NOT NULL DEFAULT '' COMMENT '',
288 `note` text COMMENT '',
289 `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
291 ) DEFAULT COLLATE utf8mb4_general_ci;
296 CREATE TABLE IF NOT EXISTS `gcign` (
297 `id` int unsigned NOT NULL auto_increment COMMENT '',
298 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
299 `gcid` int unsigned NOT NULL DEFAULT 0 COMMENT '',
302 INDEX `gcid` (`gcid`)
303 ) DEFAULT COLLATE utf8mb4_general_ci;
308 CREATE TABLE IF NOT EXISTS `gcontact` (
309 `id` int unsigned NOT NULL auto_increment COMMENT '',
310 `name` varchar(255) NOT NULL DEFAULT '' COMMENT '',
311 `nick` varchar(255) NOT NULL DEFAULT '' COMMENT '',
312 `url` varchar(255) NOT NULL DEFAULT '' COMMENT '',
313 `nurl` varchar(255) NOT NULL DEFAULT '' COMMENT '',
314 `photo` varchar(255) NOT NULL DEFAULT '' COMMENT '',
315 `connect` varchar(255) NOT NULL DEFAULT '' COMMENT '',
316 `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
317 `updated` datetime DEFAULT '0001-01-01 00:00:00' COMMENT '',
318 `last_contact` datetime DEFAULT '0001-01-01 00:00:00' COMMENT '',
319 `last_failure` datetime DEFAULT '0001-01-01 00:00:00' COMMENT '',
320 `location` varchar(255) NOT NULL DEFAULT '' COMMENT '',
321 `about` text COMMENT '',
322 `keywords` text COMMENT '',
323 `gender` varchar(32) NOT NULL DEFAULT '' COMMENT '',
324 `birthday` varchar(32) NOT NULL DEFAULT '0001-01-01' COMMENT '',
325 `community` boolean NOT NULL DEFAULT '0' COMMENT '',
326 `contact-type` tinyint NOT NULL DEFAULT -1 COMMENT '',
327 `hide` boolean NOT NULL DEFAULT '0' COMMENT '',
328 `nsfw` boolean NOT NULL DEFAULT '0' COMMENT '',
329 `network` char(4) NOT NULL DEFAULT '' COMMENT '',
330 `addr` varchar(255) NOT NULL DEFAULT '' COMMENT '',
331 `notify` varchar(255) COMMENT '',
332 `alias` varchar(255) NOT NULL DEFAULT '' COMMENT '',
333 `generation` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
334 `server_url` varchar(255) NOT NULL DEFAULT '' COMMENT '',
336 UNIQUE INDEX `nurl` (`nurl`(190)),
337 INDEX `name` (`name`(64)),
338 INDEX `nick` (`nick`(32)),
339 INDEX `addr` (`addr`(64)),
340 INDEX `hide_network_updated` (`hide`,`network`,`updated`),
341 INDEX `updated` (`updated`)
342 ) DEFAULT COLLATE utf8mb4_general_ci;
347 CREATE TABLE IF NOT EXISTS `glink` (
348 `id` int unsigned NOT NULL auto_increment COMMENT '',
349 `cid` int unsigned NOT NULL DEFAULT 0 COMMENT '',
350 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
351 `gcid` int unsigned NOT NULL DEFAULT 0 COMMENT '',
352 `zcid` int unsigned NOT NULL DEFAULT 0 COMMENT '',
353 `updated` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
355 UNIQUE INDEX `cid_uid_gcid_zcid` (`cid`,`uid`,`gcid`,`zcid`),
356 INDEX `gcid` (`gcid`)
357 ) DEFAULT COLLATE utf8mb4_general_ci;
362 CREATE TABLE IF NOT EXISTS `group` (
363 `id` int unsigned NOT NULL auto_increment COMMENT '',
364 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
365 `visible` boolean NOT NULL DEFAULT '0' COMMENT '',
366 `deleted` boolean NOT NULL DEFAULT '0' COMMENT '',
367 `name` varchar(255) NOT NULL DEFAULT '' COMMENT '',
370 ) DEFAULT COLLATE utf8mb4_general_ci;
373 -- TABLE group_member
375 CREATE TABLE IF NOT EXISTS `group_member` (
376 `id` int unsigned NOT NULL auto_increment COMMENT '',
377 `gid` int unsigned NOT NULL DEFAULT 0 COMMENT '',
378 `contact-id` int unsigned NOT NULL DEFAULT 0 COMMENT '',
380 INDEX `contactid` (`contact-id`),
381 UNIQUE INDEX `gid_contactid` (`gid`,`contact-id`)
382 ) DEFAULT COLLATE utf8mb4_general_ci;
387 CREATE TABLE IF NOT EXISTS `gserver` (
388 `id` int unsigned NOT NULL auto_increment COMMENT '',
389 `url` varchar(255) NOT NULL DEFAULT '' COMMENT '',
390 `nurl` varchar(255) NOT NULL DEFAULT '' COMMENT '',
391 `version` varchar(255) NOT NULL DEFAULT '' COMMENT '',
392 `site_name` varchar(255) NOT NULL DEFAULT '' COMMENT '',
393 `info` text COMMENT '',
394 `register_policy` tinyint NOT NULL DEFAULT 0 COMMENT '',
395 `registered-users` int unsigned NOT NULL DEFAULT 0 COMMENT '',
396 `poco` varchar(255) NOT NULL DEFAULT '' COMMENT '',
397 `noscrape` varchar(255) NOT NULL DEFAULT '' COMMENT '',
398 `network` char(4) NOT NULL DEFAULT '' COMMENT '',
399 `platform` varchar(255) NOT NULL DEFAULT '' COMMENT '',
400 `relay-subscribe` boolean NOT NULL DEFAULT '0' COMMENT 'Has the server subscribed to the relay system',
401 `relay-scope` varchar(10) NOT NULL DEFAULT '' COMMENT 'The scope of messages that the server wants to get',
402 `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
403 `last_poco_query` datetime DEFAULT '0001-01-01 00:00:00' COMMENT '',
404 `last_contact` datetime DEFAULT '0001-01-01 00:00:00' COMMENT '',
405 `last_failure` datetime DEFAULT '0001-01-01 00:00:00' COMMENT '',
407 UNIQUE INDEX `nurl` (`nurl`(190))
408 ) DEFAULT COLLATE utf8mb4_general_ci;
413 CREATE TABLE IF NOT EXISTS `gserver-tag` (
414 `gserver-id` int unsigned NOT NULL DEFAULT 0 COMMENT 'The id of the gserver',
415 `tag` varchar(100) NOT NULL DEFAULT '' COMMENT 'Tag that the server has subscribed',
416 PRIMARY KEY(`gserver-id`,`tag`),
418 ) DEFAULT COLLATE utf8mb4_general_ci;
423 CREATE TABLE IF NOT EXISTS `hook` (
424 `id` int unsigned NOT NULL auto_increment COMMENT '',
425 `hook` varbinary(100) NOT NULL DEFAULT '' COMMENT '',
426 `file` varbinary(200) NOT NULL DEFAULT '' COMMENT '',
427 `function` varbinary(200) NOT NULL DEFAULT '' COMMENT '',
428 `priority` smallint unsigned NOT NULL DEFAULT 0 COMMENT '',
430 UNIQUE INDEX `hook_file_function` (`hook`,`file`,`function`)
431 ) DEFAULT COLLATE utf8mb4_general_ci;
436 CREATE TABLE IF NOT EXISTS `intro` (
437 `id` int unsigned NOT NULL auto_increment COMMENT '',
438 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
439 `fid` int unsigned NOT NULL DEFAULT 0 COMMENT '',
440 `contact-id` int unsigned NOT NULL DEFAULT 0 COMMENT '',
441 `knowyou` boolean NOT NULL DEFAULT '0' COMMENT '',
442 `duplex` boolean NOT NULL DEFAULT '0' COMMENT '',
443 `note` text COMMENT '',
444 `hash` varchar(255) NOT NULL DEFAULT '' COMMENT '',
445 `datetime` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
446 `blocked` boolean NOT NULL DEFAULT '1' COMMENT '',
447 `ignore` boolean NOT NULL DEFAULT '0' COMMENT '',
449 ) DEFAULT COLLATE utf8mb4_general_ci;
454 CREATE TABLE IF NOT EXISTS `item` (
455 `id` int unsigned NOT NULL auto_increment,
456 `guid` varchar(255) NOT NULL DEFAULT '' COMMENT '',
457 `uri` varchar(255) NOT NULL DEFAULT '' COMMENT '',
458 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
459 `contact-id` int unsigned NOT NULL DEFAULT 0 COMMENT '',
460 `type` varchar(20) NOT NULL DEFAULT '' COMMENT '',
461 `wall` boolean NOT NULL DEFAULT '0' COMMENT '',
462 `gravity` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
463 `parent` int unsigned NOT NULL DEFAULT 0 COMMENT '',
464 `parent-uri` varchar(255) NOT NULL DEFAULT '' COMMENT '',
465 `extid` varchar(255) NOT NULL DEFAULT '' COMMENT '',
466 `thr-parent` varchar(255) NOT NULL DEFAULT '' COMMENT '',
467 `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
468 `edited` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
469 `commented` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
470 `received` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
471 `changed` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
472 `owner-id` int unsigned NOT NULL DEFAULT 0 COMMENT '',
473 `owner-name` varchar(255) NOT NULL DEFAULT '' COMMENT '',
474 `owner-link` varchar(255) NOT NULL DEFAULT '' COMMENT '',
475 `owner-avatar` varchar(255) NOT NULL DEFAULT '' COMMENT '',
476 `author-id` int unsigned NOT NULL DEFAULT 0 COMMENT '',
477 `author-name` varchar(255) NOT NULL DEFAULT '' COMMENT '',
478 `author-link` varchar(255) NOT NULL DEFAULT '' COMMENT '',
479 `author-avatar` varchar(255) NOT NULL DEFAULT '' COMMENT '',
480 `title` varchar(255) NOT NULL DEFAULT '' COMMENT '',
481 `content-warning` varchar(255) NOT NULL DEFAULT '' COMMENT '',
482 `body` mediumtext COMMENT '',
483 `app` varchar(255) NOT NULL DEFAULT '' COMMENT '',
484 `verb` varchar(100) NOT NULL DEFAULT '' COMMENT '',
485 `object-type` varchar(100) NOT NULL DEFAULT '' COMMENT '',
486 `object` text COMMENT '',
487 `target-type` varchar(100) NOT NULL DEFAULT '' COMMENT '',
488 `target` text COMMENT '',
489 `postopts` text COMMENT '',
490 `plink` varchar(255) NOT NULL DEFAULT '' COMMENT '',
491 `resource-id` varchar(32) NOT NULL DEFAULT '' COMMENT '',
492 `event-id` int unsigned NOT NULL DEFAULT 0 COMMENT '',
493 `tag` mediumtext COMMENT '',
494 `attach` mediumtext COMMENT '',
495 `inform` mediumtext COMMENT '',
496 `file` mediumtext COMMENT '',
497 `location` varchar(255) NOT NULL DEFAULT '' COMMENT '',
498 `coord` varchar(255) NOT NULL DEFAULT '' COMMENT '',
499 `allow_cid` mediumtext COMMENT '',
500 `allow_gid` mediumtext COMMENT '',
501 `deny_cid` mediumtext COMMENT '',
502 `deny_gid` mediumtext COMMENT '',
503 `private` boolean NOT NULL DEFAULT '0' COMMENT '',
504 `pubmail` boolean NOT NULL DEFAULT '0' COMMENT '',
505 `moderated` boolean NOT NULL DEFAULT '0' COMMENT '',
506 `visible` boolean NOT NULL DEFAULT '0' COMMENT '',
507 `spam` boolean NOT NULL DEFAULT '0' COMMENT '',
508 `starred` boolean NOT NULL DEFAULT '0' COMMENT '',
509 `bookmark` boolean NOT NULL DEFAULT '0' COMMENT '',
510 `unseen` boolean NOT NULL DEFAULT '1' COMMENT '',
511 `deleted` boolean NOT NULL DEFAULT '0' COMMENT '',
512 `origin` boolean NOT NULL DEFAULT '0' COMMENT '',
513 `forum_mode` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
514 `mention` boolean NOT NULL DEFAULT '0' COMMENT '',
515 `network` char(4) NOT NULL DEFAULT '' COMMENT '',
516 `rendered-hash` varchar(32) NOT NULL DEFAULT '' COMMENT '',
517 `rendered-html` mediumtext COMMENT '',
518 `global` boolean NOT NULL DEFAULT '0' COMMENT '',
520 INDEX `guid` (`guid`(191)),
521 INDEX `uri` (`uri`(191)),
522 INDEX `parent` (`parent`),
523 INDEX `parent-uri` (`parent-uri`(191)),
524 INDEX `extid` (`extid`(191)),
525 INDEX `uid_id` (`uid`,`id`),
526 INDEX `uid_contactid_id` (`uid`,`contact-id`,`id`),
527 INDEX `uid_created` (`uid`,`created`),
528 INDEX `uid_commented` (`uid`,`commented`),
529 INDEX `uid_unseen_contactid` (`uid`,`unseen`,`contact-id`),
530 INDEX `uid_network_received` (`uid`,`network`,`received`),
531 INDEX `uid_network_commented` (`uid`,`network`,`commented`),
532 INDEX `uid_thrparent` (`uid`,`thr-parent`(190)),
533 INDEX `uid_parenturi` (`uid`,`parent-uri`(190)),
534 INDEX `uid_contactid_created` (`uid`,`contact-id`,`created`),
535 INDEX `authorid_created` (`author-id`,`created`),
536 INDEX `ownerid` (`owner-id`),
537 INDEX `uid_uri` (`uid`,`uri`(190)),
538 INDEX `resource-id` (`resource-id`),
539 INDEX `contactid_allowcid_allowpid_denycid_denygid` (`contact-id`,`allow_cid`(10),`allow_gid`(10),`deny_cid`(10),`deny_gid`(10)),
540 INDEX `uid_type_changed` (`uid`,`type`,`changed`),
541 INDEX `contactid_verb` (`contact-id`,`verb`),
542 INDEX `deleted_changed` (`deleted`,`changed`),
543 INDEX `uid_wall_changed` (`uid`,`wall`,`changed`),
544 INDEX `uid_eventid` (`uid`,`event-id`),
545 INDEX `uid_authorlink` (`uid`,`author-link`(190)),
546 INDEX `uid_ownerlink` (`uid`,`owner-link`(190))
547 ) DEFAULT COLLATE utf8mb4_general_ci;
552 CREATE TABLE IF NOT EXISTS `locks` (
553 `id` int unsigned NOT NULL auto_increment COMMENT '',
554 `name` varchar(128) NOT NULL DEFAULT '' COMMENT '',
555 `locked` boolean NOT NULL DEFAULT '0' COMMENT '',
556 `pid` int unsigned NOT NULL DEFAULT 0 COMMENT '',
558 ) DEFAULT COLLATE utf8mb4_general_ci;
563 CREATE TABLE IF NOT EXISTS `mail` (
564 `id` int unsigned NOT NULL auto_increment COMMENT '',
565 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
566 `guid` varchar(255) NOT NULL DEFAULT '' COMMENT '',
567 `from-name` varchar(255) NOT NULL DEFAULT '' COMMENT '',
568 `from-photo` varchar(255) NOT NULL DEFAULT '' COMMENT '',
569 `from-url` varchar(255) NOT NULL DEFAULT '' COMMENT '',
570 `contact-id` varchar(255) NOT NULL DEFAULT '' COMMENT '',
571 `convid` int unsigned NOT NULL DEFAULT 0 COMMENT '',
572 `title` varchar(255) NOT NULL DEFAULT '' COMMENT '',
573 `body` mediumtext COMMENT '',
574 `seen` boolean NOT NULL DEFAULT '0' COMMENT '',
575 `reply` boolean NOT NULL DEFAULT '0' COMMENT '',
576 `replied` boolean NOT NULL DEFAULT '0' COMMENT '',
577 `unknown` boolean NOT NULL DEFAULT '0' COMMENT '',
578 `uri` varchar(255) NOT NULL DEFAULT '' COMMENT '',
579 `parent-uri` varchar(255) NOT NULL DEFAULT '' COMMENT '',
580 `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
582 INDEX `uid_seen` (`uid`,`seen`),
583 INDEX `convid` (`convid`),
584 INDEX `uri` (`uri`(64)),
585 INDEX `parent-uri` (`parent-uri`(64)),
586 INDEX `contactid` (`contact-id`(32))
587 ) DEFAULT COLLATE utf8mb4_general_ci;
592 CREATE TABLE IF NOT EXISTS `mailacct` (
593 `id` int unsigned NOT NULL auto_increment COMMENT '',
594 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
595 `server` varchar(255) NOT NULL DEFAULT '' COMMENT '',
596 `port` smallint unsigned NOT NULL DEFAULT 0 COMMENT '',
597 `ssltype` varchar(16) NOT NULL DEFAULT '' COMMENT '',
598 `mailbox` varchar(255) NOT NULL DEFAULT '' COMMENT '',
599 `user` varchar(255) NOT NULL DEFAULT '' COMMENT '',
600 `pass` text COMMENT '',
601 `reply_to` varchar(255) NOT NULL DEFAULT '' COMMENT '',
602 `action` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
603 `movetofolder` varchar(255) NOT NULL DEFAULT '' COMMENT '',
604 `pubmail` boolean NOT NULL DEFAULT '0' COMMENT '',
605 `last_check` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
607 ) DEFAULT COLLATE utf8mb4_general_ci;
612 CREATE TABLE IF NOT EXISTS `manage` (
613 `id` int unsigned NOT NULL auto_increment COMMENT '',
614 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
615 `mid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
617 UNIQUE INDEX `uid_mid` (`uid`,`mid`)
618 ) DEFAULT COLLATE utf8mb4_general_ci;
623 CREATE TABLE IF NOT EXISTS `notify` (
624 `id` int unsigned NOT NULL auto_increment COMMENT '',
625 `hash` varchar(64) NOT NULL DEFAULT '' COMMENT '',
626 `type` smallint unsigned NOT NULL DEFAULT 0 COMMENT '',
627 `name` varchar(255) NOT NULL DEFAULT '' COMMENT '',
628 `url` varchar(255) NOT NULL DEFAULT '' COMMENT '',
629 `photo` varchar(255) NOT NULL DEFAULT '' COMMENT '',
630 `date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
631 `msg` mediumtext COMMENT '',
632 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
633 `link` varchar(255) NOT NULL DEFAULT '' COMMENT '',
634 `iid` int unsigned NOT NULL DEFAULT 0 COMMENT '',
635 `parent` int unsigned NOT NULL DEFAULT 0 COMMENT '',
636 `seen` boolean NOT NULL DEFAULT '0' COMMENT '',
637 `verb` varchar(100) NOT NULL DEFAULT '' COMMENT '',
638 `otype` varchar(10) NOT NULL DEFAULT '' COMMENT '',
639 `name_cache` tinytext COMMENT '',
640 `msg_cache` mediumtext COMMENT '',
642 INDEX `hash_uid` (`hash`,`uid`),
643 INDEX `seen_uid_date` (`seen`,`uid`,`date`),
644 INDEX `uid_date` (`uid`,`date`),
645 INDEX `uid_type_link` (`uid`,`type`,`link`(190))
646 ) DEFAULT COLLATE utf8mb4_general_ci;
649 -- TABLE notify-threads
651 CREATE TABLE IF NOT EXISTS `notify-threads` (
652 `id` int unsigned NOT NULL auto_increment COMMENT '',
653 `notify-id` int unsigned NOT NULL DEFAULT 0 COMMENT '',
654 `master-parent-item` int unsigned NOT NULL DEFAULT 0 COMMENT '',
655 `parent-item` int unsigned NOT NULL DEFAULT 0 COMMENT '',
656 `receiver-uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
658 ) DEFAULT COLLATE utf8mb4_general_ci;
663 CREATE TABLE IF NOT EXISTS `oembed` (
664 `url` varbinary(255) NOT NULL COMMENT '',
665 `maxwidth` mediumint unsigned NOT NULL COMMENT '',
666 `content` mediumtext COMMENT '',
667 `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
668 PRIMARY KEY(`url`,`maxwidth`),
669 INDEX `created` (`created`)
670 ) DEFAULT COLLATE utf8mb4_general_ci;
675 CREATE TABLE IF NOT EXISTS `parsed_url` (
676 `url` varbinary(255) NOT NULL COMMENT '',
677 `guessing` boolean NOT NULL DEFAULT '0' COMMENT '',
678 `oembed` boolean NOT NULL DEFAULT '0' COMMENT '',
679 `content` mediumtext COMMENT '',
680 `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
681 PRIMARY KEY(`url`,`guessing`,`oembed`),
682 INDEX `created` (`created`)
683 ) DEFAULT COLLATE utf8mb4_general_ci;
686 -- TABLE participation
688 CREATE TABLE IF NOT EXISTS `participation` (
689 `iid` int unsigned NOT NULL COMMENT '',
690 `server` varchar(60) NOT NULL COMMENT '',
691 `cid` int unsigned NOT NULL COMMENT '',
692 `fid` int unsigned NOT NULL COMMENT '',
693 PRIMARY KEY(`iid`,`server`)
694 ) DEFAULT COLLATE utf8mb4_general_ci;
699 CREATE TABLE IF NOT EXISTS `pconfig` (
700 `id` int unsigned NOT NULL auto_increment COMMENT '',
701 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
702 `cat` varbinary(50) NOT NULL DEFAULT '' COMMENT '',
703 `k` varbinary(100) NOT NULL DEFAULT '' COMMENT '',
704 `v` mediumtext COMMENT '',
706 UNIQUE INDEX `uid_cat_k` (`uid`,`cat`,`k`)
707 ) DEFAULT COLLATE utf8mb4_general_ci;
712 CREATE TABLE IF NOT EXISTS `photo` (
713 `id` int unsigned NOT NULL auto_increment COMMENT '',
714 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
715 `contact-id` int unsigned NOT NULL DEFAULT 0 COMMENT '',
716 `guid` char(16) NOT NULL DEFAULT '' COMMENT '',
717 `resource-id` char(32) NOT NULL DEFAULT '' COMMENT '',
718 `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
719 `edited` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
720 `title` varchar(255) NOT NULL DEFAULT '' COMMENT '',
721 `desc` text COMMENT '',
722 `album` varchar(255) NOT NULL DEFAULT '' COMMENT '',
723 `filename` varchar(255) NOT NULL DEFAULT '' COMMENT '',
724 `type` varchar(30) NOT NULL DEFAULT 'image/jpeg',
725 `height` smallint unsigned NOT NULL DEFAULT 0 COMMENT '',
726 `width` smallint unsigned NOT NULL DEFAULT 0 COMMENT '',
727 `datasize` int unsigned NOT NULL DEFAULT 0 COMMENT '',
728 `data` mediumblob NOT NULL COMMENT '',
729 `scale` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
730 `profile` boolean NOT NULL DEFAULT '0' COMMENT '',
731 `allow_cid` mediumtext COMMENT '',
732 `allow_gid` mediumtext COMMENT '',
733 `deny_cid` mediumtext COMMENT '',
734 `deny_gid` mediumtext COMMENT '',
736 INDEX `contactid` (`contact-id`),
737 INDEX `uid_contactid` (`uid`,`contact-id`),
738 INDEX `uid_profile` (`uid`,`profile`),
739 INDEX `uid_album_scale_created` (`uid`,`album`(32),`scale`,`created`),
740 INDEX `uid_album_resource-id_created` (`uid`,`album`(32),`resource-id`,`created`),
741 INDEX `resource-id` (`resource-id`)
742 ) DEFAULT COLLATE utf8mb4_general_ci;
747 CREATE TABLE IF NOT EXISTS `poll` (
748 `id` int unsigned NOT NULL auto_increment COMMENT '',
749 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
750 `q0` text COMMENT '',
751 `q1` text COMMENT '',
752 `q2` text COMMENT '',
753 `q3` text COMMENT '',
754 `q4` text COMMENT '',
755 `q5` text COMMENT '',
756 `q6` text COMMENT '',
757 `q7` text COMMENT '',
758 `q8` text COMMENT '',
759 `q9` text COMMENT '',
762 ) DEFAULT COLLATE utf8mb4_general_ci;
767 CREATE TABLE IF NOT EXISTS `poll_result` (
768 `id` int unsigned NOT NULL auto_increment COMMENT '',
769 `poll_id` int unsigned NOT NULL DEFAULT 0,
770 `choice` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
772 INDEX `poll_id` (`poll_id`)
773 ) DEFAULT COLLATE utf8mb4_general_ci;
778 CREATE TABLE IF NOT EXISTS `process` (
779 `pid` int unsigned NOT NULL COMMENT '',
780 `command` varbinary(32) NOT NULL DEFAULT '' COMMENT '',
781 `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
783 INDEX `command` (`command`)
784 ) DEFAULT COLLATE utf8mb4_general_ci;
789 CREATE TABLE IF NOT EXISTS `profile` (
790 `id` int unsigned NOT NULL auto_increment COMMENT '',
791 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
792 `profile-name` varchar(255) NOT NULL DEFAULT '' COMMENT '',
793 `is-default` boolean NOT NULL DEFAULT '0' COMMENT '',
794 `hide-friends` boolean NOT NULL DEFAULT '0' COMMENT '',
795 `name` varchar(255) NOT NULL DEFAULT '' COMMENT '',
796 `pdesc` varchar(255) NOT NULL DEFAULT '' COMMENT '',
797 `dob` varchar(32) NOT NULL DEFAULT '0000-00-00' COMMENT '',
798 `address` varchar(255) NOT NULL DEFAULT '' COMMENT '',
799 `locality` varchar(255) NOT NULL DEFAULT '' COMMENT '',
800 `region` varchar(255) NOT NULL DEFAULT '' COMMENT '',
801 `postal-code` varchar(32) NOT NULL DEFAULT '' COMMENT '',
802 `country-name` varchar(255) NOT NULL DEFAULT '' COMMENT '',
803 `hometown` varchar(255) NOT NULL DEFAULT '' COMMENT '',
804 `gender` varchar(32) NOT NULL DEFAULT '' COMMENT '',
805 `marital` varchar(255) NOT NULL DEFAULT '' COMMENT '',
806 `with` text COMMENT '',
807 `howlong` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
808 `sexual` varchar(255) NOT NULL DEFAULT '' COMMENT '',
809 `politic` varchar(255) NOT NULL DEFAULT '' COMMENT '',
810 `religion` varchar(255) NOT NULL DEFAULT '' COMMENT '',
811 `pub_keywords` text COMMENT '',
812 `prv_keywords` text COMMENT '',
813 `likes` text COMMENT '',
814 `dislikes` text COMMENT '',
815 `about` text COMMENT '',
816 `summary` varchar(255) NOT NULL DEFAULT '' COMMENT '',
817 `music` text COMMENT '',
818 `book` text COMMENT '',
819 `tv` text COMMENT '',
820 `film` text COMMENT '',
821 `interest` text COMMENT '',
822 `romance` text COMMENT '',
823 `work` text COMMENT '',
824 `education` text COMMENT '',
825 `contact` text COMMENT '',
826 `homepage` varchar(255) NOT NULL DEFAULT '' COMMENT '',
827 `xmpp` varchar(255) NOT NULL DEFAULT '' COMMENT '',
828 `photo` varchar(255) NOT NULL DEFAULT '' COMMENT '',
829 `thumb` varchar(255) NOT NULL DEFAULT '' COMMENT '',
830 `publish` boolean NOT NULL DEFAULT '0' COMMENT '',
831 `net-publish` boolean NOT NULL DEFAULT '0' COMMENT '',
833 INDEX `uid_is-default` (`uid`,`is-default`)
834 ) DEFAULT COLLATE utf8mb4_general_ci;
837 -- TABLE profile_check
839 CREATE TABLE IF NOT EXISTS `profile_check` (
840 `id` int unsigned NOT NULL auto_increment COMMENT '',
841 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
842 `cid` int unsigned NOT NULL DEFAULT 0 COMMENT '',
843 `dfrn_id` varchar(255) NOT NULL DEFAULT '' COMMENT '',
844 `sec` varchar(255) NOT NULL DEFAULT '' COMMENT '',
845 `expire` int unsigned NOT NULL DEFAULT 0 COMMENT '',
847 ) DEFAULT COLLATE utf8mb4_general_ci;
850 -- TABLE push_subscriber
852 CREATE TABLE IF NOT EXISTS `push_subscriber` (
853 `id` int unsigned NOT NULL auto_increment COMMENT '',
854 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
855 `callback_url` varchar(255) NOT NULL DEFAULT '' COMMENT '',
856 `topic` varchar(255) NOT NULL DEFAULT '' COMMENT '',
857 `nickname` varchar(255) NOT NULL DEFAULT '' COMMENT '',
858 `push` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
859 `last_update` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
860 `secret` varchar(255) NOT NULL DEFAULT '' COMMENT '',
862 ) DEFAULT COLLATE utf8mb4_general_ci;
867 CREATE TABLE IF NOT EXISTS `queue` (
868 `id` int unsigned NOT NULL auto_increment COMMENT '',
869 `cid` int unsigned NOT NULL DEFAULT 0 COMMENT 'Message receiver',
870 `network` char(4) NOT NULL DEFAULT '' COMMENT 'Receiver\'s network',
871 `guid` varchar(255) NOT NULL DEFAULT '' COMMENT 'Unique GUID of the message',
872 `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Date, when the message was created',
873 `last` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Date of last trial',
874 `next` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Next retrial date',
875 `retrial` tinyint NOT NULL DEFAULT 0 COMMENT 'Retrial counter',
876 `content` mediumtext COMMENT '',
877 `batch` boolean NOT NULL DEFAULT '0' COMMENT '',
879 INDEX `last` (`last`),
880 INDEX `next` (`next`)
881 ) DEFAULT COLLATE utf8mb4_general_ci;
886 CREATE TABLE IF NOT EXISTS `register` (
887 `id` int unsigned NOT NULL auto_increment COMMENT '',
888 `hash` varchar(255) NOT NULL DEFAULT '' COMMENT '',
889 `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
890 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
891 `password` varchar(255) NOT NULL DEFAULT '' COMMENT '',
892 `language` varchar(16) NOT NULL DEFAULT '' COMMENT '',
893 `note` text COMMENT '',
895 ) DEFAULT COLLATE utf8mb4_general_ci;
900 CREATE TABLE IF NOT EXISTS `search` (
901 `id` int unsigned NOT NULL auto_increment COMMENT '',
902 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
903 `term` varchar(255) NOT NULL DEFAULT '' COMMENT '',
906 ) DEFAULT COLLATE utf8mb4_general_ci;
911 CREATE TABLE IF NOT EXISTS `session` (
912 `id` bigint unsigned NOT NULL auto_increment COMMENT '',
913 `sid` varbinary(255) NOT NULL DEFAULT '' COMMENT '',
914 `data` text COMMENT '',
915 `expire` int unsigned NOT NULL DEFAULT 0 COMMENT '',
917 INDEX `sid` (`sid`(64)),
918 INDEX `expire` (`expire`)
919 ) DEFAULT COLLATE utf8mb4_general_ci;
924 CREATE TABLE IF NOT EXISTS `sign` (
925 `id` int unsigned NOT NULL auto_increment COMMENT '',
926 `iid` int unsigned NOT NULL DEFAULT 0 COMMENT '',
927 `signed_text` mediumtext COMMENT '',
928 `signature` text COMMENT '',
929 `signer` varchar(255) NOT NULL DEFAULT '' COMMENT '',
931 UNIQUE INDEX `iid` (`iid`)
932 ) DEFAULT COLLATE utf8mb4_general_ci;
937 CREATE TABLE IF NOT EXISTS `term` (
938 `tid` int unsigned NOT NULL auto_increment COMMENT '',
939 `oid` int unsigned NOT NULL DEFAULT 0 COMMENT '',
940 `otype` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
941 `type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
942 `term` varchar(255) NOT NULL DEFAULT '' COMMENT '',
943 `url` varchar(255) NOT NULL DEFAULT '' COMMENT '',
944 `guid` varchar(255) NOT NULL DEFAULT '' COMMENT '',
945 `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
946 `received` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
947 `global` boolean NOT NULL DEFAULT '0' COMMENT '',
948 `aid` int unsigned NOT NULL DEFAULT 0 COMMENT '',
949 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
951 INDEX `oid_otype_type_term` (`oid`,`otype`,`type`,`term`(32)),
952 INDEX `uid_otype_type_term_global_created` (`uid`,`otype`,`type`,`term`(32),`global`,`created`),
953 INDEX `uid_otype_type_url` (`uid`,`otype`,`type`,`url`(64)),
954 INDEX `guid` (`guid`(64))
955 ) DEFAULT COLLATE utf8mb4_general_ci;
960 CREATE TABLE IF NOT EXISTS `thread` (
961 `iid` int unsigned NOT NULL DEFAULT 0 COMMENT '',
962 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
963 `contact-id` int unsigned NOT NULL DEFAULT 0 COMMENT '',
964 `owner-id` int unsigned NOT NULL DEFAULT 0 COMMENT '',
965 `author-id` int unsigned NOT NULL DEFAULT 0 COMMENT '',
966 `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
967 `edited` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
968 `commented` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
969 `received` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
970 `changed` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
971 `wall` boolean NOT NULL DEFAULT '0' COMMENT '',
972 `private` boolean NOT NULL DEFAULT '0' COMMENT '',
973 `pubmail` boolean NOT NULL DEFAULT '0' COMMENT '',
974 `moderated` boolean NOT NULL DEFAULT '0' COMMENT '',
975 `visible` boolean NOT NULL DEFAULT '0' COMMENT '',
976 `spam` boolean NOT NULL DEFAULT '0' COMMENT '',
977 `starred` boolean NOT NULL DEFAULT '0' COMMENT '',
978 `ignored` boolean NOT NULL DEFAULT '0' COMMENT '',
979 `bookmark` boolean NOT NULL DEFAULT '0' COMMENT '',
980 `unseen` boolean NOT NULL DEFAULT '1' COMMENT '',
981 `deleted` boolean NOT NULL DEFAULT '0' COMMENT '',
982 `origin` boolean NOT NULL DEFAULT '0' COMMENT '',
983 `forum_mode` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
984 `mention` boolean NOT NULL DEFAULT '0' COMMENT '',
985 `network` char(4) NOT NULL DEFAULT '' COMMENT '',
987 INDEX `uid_network_commented` (`uid`,`network`,`commented`),
988 INDEX `uid_network_created` (`uid`,`network`,`created`),
989 INDEX `uid_contactid_commented` (`uid`,`contact-id`,`commented`),
990 INDEX `uid_contactid_created` (`uid`,`contact-id`,`created`),
991 INDEX `contactid` (`contact-id`),
992 INDEX `ownerid` (`owner-id`),
993 INDEX `authorid` (`author-id`),
994 INDEX `uid_created` (`uid`,`created`),
995 INDEX `uid_commented` (`uid`,`commented`),
996 INDEX `uid_wall_created` (`uid`,`wall`,`created`),
997 INDEX `private_wall_origin_commented` (`private`,`wall`,`origin`,`commented`)
998 ) DEFAULT COLLATE utf8mb4_general_ci;
1003 CREATE TABLE IF NOT EXISTS `tokens` (
1004 `id` varchar(40) NOT NULL COMMENT '',
1005 `secret` text COMMENT '',
1006 `client_id` varchar(20) NOT NULL DEFAULT '',
1007 `expires` int NOT NULL DEFAULT 0 COMMENT '',
1008 `scope` varchar(200) NOT NULL DEFAULT '' COMMENT '',
1009 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
1011 ) DEFAULT COLLATE utf8mb4_general_ci;
1016 CREATE TABLE IF NOT EXISTS `user` (
1017 `uid` mediumint unsigned NOT NULL auto_increment COMMENT '',
1018 `parent-uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'The parent user that has full control about this user',
1019 `guid` varchar(64) NOT NULL DEFAULT '' COMMENT '',
1020 `username` varchar(255) NOT NULL DEFAULT '' COMMENT '',
1021 `password` varchar(255) NOT NULL DEFAULT '' COMMENT '',
1022 `legacy_password` boolean NOT NULL DEFAULT '0' COMMENT 'Is the password hash double-hashed?',
1023 `nickname` varchar(255) NOT NULL DEFAULT '' COMMENT '',
1024 `email` varchar(255) NOT NULL DEFAULT '' COMMENT '',
1025 `openid` varchar(255) NOT NULL DEFAULT '' COMMENT '',
1026 `timezone` varchar(128) NOT NULL DEFAULT '' COMMENT '',
1027 `language` varchar(32) NOT NULL DEFAULT 'en' COMMENT '',
1028 `register_date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
1029 `login_date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
1030 `default-location` varchar(255) NOT NULL DEFAULT '' COMMENT '',
1031 `allow_location` boolean NOT NULL DEFAULT '0' COMMENT '',
1032 `theme` varchar(255) NOT NULL DEFAULT '' COMMENT '',
1033 `pubkey` text COMMENT '',
1034 `prvkey` text COMMENT '',
1035 `spubkey` text COMMENT '',
1036 `sprvkey` text COMMENT '',
1037 `verified` boolean NOT NULL DEFAULT '0' COMMENT '',
1038 `blocked` boolean NOT NULL DEFAULT '0' COMMENT '',
1039 `blockwall` boolean NOT NULL DEFAULT '0' COMMENT '',
1040 `hidewall` boolean NOT NULL DEFAULT '0' COMMENT '',
1041 `blocktags` boolean NOT NULL DEFAULT '0' COMMENT '',
1042 `unkmail` boolean NOT NULL DEFAULT '0' COMMENT '',
1043 `cntunkmail` int unsigned NOT NULL DEFAULT 10 COMMENT '',
1044 `notify-flags` smallint unsigned NOT NULL DEFAULT 65535 COMMENT '',
1045 `page-flags` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
1046 `account-type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
1047 `prvnets` boolean NOT NULL DEFAULT '0' COMMENT '',
1048 `pwdreset` varchar(255) COMMENT 'Password reset request token',
1049 `pwdreset_time` datetime COMMENT 'Timestamp of the last password reset request',
1050 `maxreq` int unsigned NOT NULL DEFAULT 10 COMMENT '',
1051 `expire` int unsigned NOT NULL DEFAULT 0 COMMENT '',
1052 `account_removed` boolean NOT NULL DEFAULT '0' COMMENT '',
1053 `account_expired` boolean NOT NULL DEFAULT '0' COMMENT '',
1054 `account_expires_on` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
1055 `expire_notification_sent` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
1056 `def_gid` int unsigned NOT NULL DEFAULT 0 COMMENT '',
1057 `allow_cid` mediumtext COMMENT '',
1058 `allow_gid` mediumtext COMMENT '',
1059 `deny_cid` mediumtext COMMENT '',
1060 `deny_gid` mediumtext COMMENT '',
1061 `openidserver` text COMMENT '',
1063 INDEX `nickname` (`nickname`(32))
1064 ) DEFAULT COLLATE utf8mb4_general_ci;
1069 CREATE TABLE IF NOT EXISTS `userd` (
1070 `id` int unsigned NOT NULL auto_increment COMMENT '',
1071 `username` varchar(255) NOT NULL COMMENT '',
1073 INDEX `username` (`username`(32))
1074 ) DEFAULT COLLATE utf8mb4_general_ci;
1077 -- TABLE workerqueue
1079 CREATE TABLE IF NOT EXISTS `workerqueue` (
1080 `id` int unsigned NOT NULL auto_increment COMMENT 'Auto incremented worker task id',
1081 `parameter` mediumblob COMMENT 'Task command',
1082 `priority` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'Task priority',
1083 `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Creation date',
1084 `pid` int unsigned NOT NULL DEFAULT 0 COMMENT 'Process id of the worker',
1085 `executed` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Execution date',
1086 `done` boolean NOT NULL DEFAULT '0' COMMENT 'Marked when the task was done, will be deleted later',
1088 INDEX `pid` (`pid`),
1089 INDEX `parameter` (`parameter`(64)),
1090 INDEX `priority_created` (`priority`,`created`),
1091 INDEX `executed` (`executed`)
1092 ) DEFAULT COLLATE utf8mb4_general_ci;