1 -- ------------------------------------------
2 -- Friendica 3.6-dev (Asparagus)
3 -- DB_UPDATE_VERSION 1255
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 '',
59 `v` mediumtext COMMENT '',
60 `expire_mode` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
61 `updated` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
63 INDEX `expire_mode_updated` (`expire_mode`,`updated`)
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) NOT NULL DEFAULT '' COMMENT '',
126 `thumb` varchar(255) NOT NULL DEFAULT '' COMMENT '',
127 `micro` varchar(255) NOT NULL 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 `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
401 `last_poco_query` datetime DEFAULT '0001-01-01 00:00:00' COMMENT '',
402 `last_contact` datetime DEFAULT '0001-01-01 00:00:00' COMMENT '',
403 `last_failure` datetime DEFAULT '0001-01-01 00:00:00' COMMENT '',
405 UNIQUE INDEX `nurl` (`nurl`(190))
406 ) DEFAULT COLLATE utf8mb4_general_ci;
411 CREATE TABLE IF NOT EXISTS `hook` (
412 `id` int unsigned NOT NULL auto_increment COMMENT '',
413 `hook` varbinary(100) NOT NULL DEFAULT '' COMMENT '',
414 `file` varbinary(200) NOT NULL DEFAULT '' COMMENT '',
415 `function` varbinary(200) NOT NULL DEFAULT '' COMMENT '',
416 `priority` smallint unsigned NOT NULL DEFAULT 0 COMMENT '',
418 UNIQUE INDEX `hook_file_function` (`hook`,`file`,`function`)
419 ) DEFAULT COLLATE utf8mb4_general_ci;
424 CREATE TABLE IF NOT EXISTS `intro` (
425 `id` int unsigned NOT NULL auto_increment COMMENT '',
426 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
427 `fid` int unsigned NOT NULL DEFAULT 0 COMMENT '',
428 `contact-id` int unsigned NOT NULL DEFAULT 0 COMMENT '',
429 `knowyou` boolean NOT NULL DEFAULT '0' COMMENT '',
430 `duplex` boolean NOT NULL DEFAULT '0' COMMENT '',
431 `note` text COMMENT '',
432 `hash` varchar(255) NOT NULL DEFAULT '' COMMENT '',
433 `datetime` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
434 `blocked` boolean NOT NULL DEFAULT '1' COMMENT '',
435 `ignore` boolean NOT NULL DEFAULT '0' COMMENT '',
437 ) DEFAULT COLLATE utf8mb4_general_ci;
442 CREATE TABLE IF NOT EXISTS `item` (
443 `id` int unsigned NOT NULL auto_increment,
444 `guid` varchar(255) NOT NULL DEFAULT '' COMMENT '',
445 `uri` varchar(255) NOT NULL DEFAULT '' COMMENT '',
446 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
447 `contact-id` int unsigned NOT NULL DEFAULT 0 COMMENT '',
448 `type` varchar(20) NOT NULL DEFAULT '' COMMENT '',
449 `wall` boolean NOT NULL DEFAULT '0' COMMENT '',
450 `gravity` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
451 `parent` int unsigned NOT NULL DEFAULT 0 COMMENT '',
452 `parent-uri` varchar(255) NOT NULL DEFAULT '' COMMENT '',
453 `extid` varchar(255) NOT NULL DEFAULT '' COMMENT '',
454 `thr-parent` varchar(255) NOT NULL DEFAULT '' COMMENT '',
455 `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
456 `edited` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
457 `commented` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
458 `received` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
459 `changed` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
460 `owner-id` int unsigned NOT NULL DEFAULT 0 COMMENT '',
461 `owner-name` varchar(255) NOT NULL DEFAULT '' COMMENT '',
462 `owner-link` varchar(255) NOT NULL DEFAULT '' COMMENT '',
463 `owner-avatar` varchar(255) NOT NULL DEFAULT '' COMMENT '',
464 `author-id` int unsigned NOT NULL DEFAULT 0 COMMENT '',
465 `author-name` varchar(255) NOT NULL DEFAULT '' COMMENT '',
466 `author-link` varchar(255) NOT NULL DEFAULT '' COMMENT '',
467 `author-avatar` varchar(255) NOT NULL DEFAULT '' COMMENT '',
468 `title` varchar(255) NOT NULL DEFAULT '' COMMENT '',
469 `body` mediumtext COMMENT '',
470 `app` varchar(255) NOT NULL DEFAULT '' COMMENT '',
471 `verb` varchar(100) NOT NULL DEFAULT '' COMMENT '',
472 `object-type` varchar(100) NOT NULL DEFAULT '' COMMENT '',
473 `object` text COMMENT '',
474 `target-type` varchar(100) NOT NULL DEFAULT '' COMMENT '',
475 `target` text COMMENT '',
476 `postopts` text COMMENT '',
477 `plink` varchar(255) NOT NULL DEFAULT '' COMMENT '',
478 `resource-id` varchar(32) NOT NULL DEFAULT '' COMMENT '',
479 `event-id` int unsigned NOT NULL DEFAULT 0 COMMENT '',
480 `tag` mediumtext COMMENT '',
481 `attach` mediumtext COMMENT '',
482 `inform` mediumtext COMMENT '',
483 `file` mediumtext COMMENT '',
484 `location` varchar(255) NOT NULL DEFAULT '' COMMENT '',
485 `coord` varchar(255) NOT NULL DEFAULT '' COMMENT '',
486 `allow_cid` mediumtext COMMENT '',
487 `allow_gid` mediumtext COMMENT '',
488 `deny_cid` mediumtext COMMENT '',
489 `deny_gid` mediumtext COMMENT '',
490 `private` boolean NOT NULL DEFAULT '0' COMMENT '',
491 `pubmail` boolean NOT NULL DEFAULT '0' COMMENT '',
492 `moderated` boolean NOT NULL DEFAULT '0' COMMENT '',
493 `visible` boolean NOT NULL DEFAULT '0' COMMENT '',
494 `spam` boolean NOT NULL DEFAULT '0' COMMENT '',
495 `starred` boolean NOT NULL DEFAULT '0' COMMENT '',
496 `bookmark` boolean NOT NULL DEFAULT '0' COMMENT '',
497 `unseen` boolean NOT NULL DEFAULT '1' COMMENT '',
498 `deleted` boolean NOT NULL DEFAULT '0' COMMENT '',
499 `origin` boolean NOT NULL DEFAULT '0' COMMENT '',
500 `forum_mode` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
501 `mention` boolean NOT NULL DEFAULT '0' COMMENT '',
502 `network` char(4) NOT NULL DEFAULT '' COMMENT '',
503 `rendered-hash` varchar(32) NOT NULL DEFAULT '' COMMENT '',
504 `rendered-html` mediumtext COMMENT '',
505 `global` boolean NOT NULL DEFAULT '0' COMMENT '',
507 INDEX `guid` (`guid`(191)),
508 INDEX `uri` (`uri`(191)),
509 INDEX `parent` (`parent`),
510 INDEX `parent-uri` (`parent-uri`(191)),
511 INDEX `extid` (`extid`(191)),
512 INDEX `uid_id` (`uid`,`id`),
513 INDEX `uid_contactid_id` (`uid`,`contact-id`,`id`),
514 INDEX `uid_created` (`uid`,`created`),
515 INDEX `uid_commented` (`uid`,`commented`),
516 INDEX `uid_unseen_contactid` (`uid`,`unseen`,`contact-id`),
517 INDEX `uid_network_received` (`uid`,`network`,`received`),
518 INDEX `uid_network_commented` (`uid`,`network`,`commented`),
519 INDEX `uid_thrparent` (`uid`,`thr-parent`(190)),
520 INDEX `uid_parenturi` (`uid`,`parent-uri`(190)),
521 INDEX `uid_contactid_created` (`uid`,`contact-id`,`created`),
522 INDEX `authorid_created` (`author-id`,`created`),
523 INDEX `ownerid` (`owner-id`),
524 INDEX `uid_uri` (`uid`,`uri`(190)),
525 INDEX `resource-id` (`resource-id`),
526 INDEX `contactid_allowcid_allowpid_denycid_denygid` (`contact-id`,`allow_cid`(10),`allow_gid`(10),`deny_cid`(10),`deny_gid`(10)),
527 INDEX `uid_type_changed` (`uid`,`type`,`changed`),
528 INDEX `contactid_verb` (`contact-id`,`verb`),
529 INDEX `deleted_changed` (`deleted`,`changed`),
530 INDEX `uid_wall_changed` (`uid`,`wall`,`changed`),
531 INDEX `uid_eventid` (`uid`,`event-id`),
532 INDEX `uid_authorlink` (`uid`,`author-link`(190)),
533 INDEX `uid_ownerlink` (`uid`,`owner-link`(190))
534 ) DEFAULT COLLATE utf8mb4_general_ci;
539 CREATE TABLE IF NOT EXISTS `locks` (
540 `id` int unsigned NOT NULL auto_increment COMMENT '',
541 `name` varchar(128) NOT NULL DEFAULT '' COMMENT '',
542 `locked` boolean NOT NULL DEFAULT '0' COMMENT '',
543 `pid` int unsigned NOT NULL DEFAULT 0 COMMENT '',
545 ) DEFAULT COLLATE utf8mb4_general_ci;
550 CREATE TABLE IF NOT EXISTS `mail` (
551 `id` int unsigned NOT NULL auto_increment COMMENT '',
552 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
553 `guid` varchar(255) NOT NULL DEFAULT '' COMMENT '',
554 `from-name` varchar(255) NOT NULL DEFAULT '' COMMENT '',
555 `from-photo` varchar(255) NOT NULL DEFAULT '' COMMENT '',
556 `from-url` varchar(255) NOT NULL DEFAULT '' COMMENT '',
557 `contact-id` varchar(255) NOT NULL DEFAULT '' COMMENT '',
558 `convid` int unsigned NOT NULL DEFAULT 0 COMMENT '',
559 `title` varchar(255) NOT NULL DEFAULT '' COMMENT '',
560 `body` mediumtext COMMENT '',
561 `seen` boolean NOT NULL DEFAULT '0' COMMENT '',
562 `reply` boolean NOT NULL DEFAULT '0' COMMENT '',
563 `replied` boolean NOT NULL DEFAULT '0' COMMENT '',
564 `unknown` boolean NOT NULL DEFAULT '0' COMMENT '',
565 `uri` varchar(255) NOT NULL DEFAULT '' COMMENT '',
566 `parent-uri` varchar(255) NOT NULL DEFAULT '' COMMENT '',
567 `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
569 INDEX `uid_seen` (`uid`,`seen`),
570 INDEX `convid` (`convid`),
571 INDEX `uri` (`uri`(64)),
572 INDEX `parent-uri` (`parent-uri`(64)),
573 INDEX `contactid` (`contact-id`(32))
574 ) DEFAULT COLLATE utf8mb4_general_ci;
579 CREATE TABLE IF NOT EXISTS `mailacct` (
580 `id` int unsigned NOT NULL auto_increment COMMENT '',
581 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
582 `server` varchar(255) NOT NULL DEFAULT '' COMMENT '',
583 `port` smallint unsigned NOT NULL DEFAULT 0 COMMENT '',
584 `ssltype` varchar(16) NOT NULL DEFAULT '' COMMENT '',
585 `mailbox` varchar(255) NOT NULL DEFAULT '' COMMENT '',
586 `user` varchar(255) NOT NULL DEFAULT '' COMMENT '',
587 `pass` text COMMENT '',
588 `reply_to` varchar(255) NOT NULL DEFAULT '' COMMENT '',
589 `action` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
590 `movetofolder` varchar(255) NOT NULL DEFAULT '' COMMENT '',
591 `pubmail` boolean NOT NULL DEFAULT '0' COMMENT '',
592 `last_check` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
594 ) DEFAULT COLLATE utf8mb4_general_ci;
599 CREATE TABLE IF NOT EXISTS `manage` (
600 `id` int unsigned NOT NULL auto_increment COMMENT '',
601 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
602 `mid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
604 UNIQUE INDEX `uid_mid` (`uid`,`mid`)
605 ) DEFAULT COLLATE utf8mb4_general_ci;
610 CREATE TABLE IF NOT EXISTS `notify` (
611 `id` int unsigned NOT NULL auto_increment COMMENT '',
612 `hash` varchar(64) NOT NULL DEFAULT '' COMMENT '',
613 `type` smallint unsigned NOT NULL DEFAULT 0 COMMENT '',
614 `name` varchar(255) NOT NULL DEFAULT '' COMMENT '',
615 `url` varchar(255) NOT NULL DEFAULT '' COMMENT '',
616 `photo` varchar(255) NOT NULL DEFAULT '' COMMENT '',
617 `date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
618 `msg` mediumtext COMMENT '',
619 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
620 `link` varchar(255) NOT NULL DEFAULT '' COMMENT '',
621 `iid` int unsigned NOT NULL DEFAULT 0 COMMENT '',
622 `parent` int unsigned NOT NULL DEFAULT 0 COMMENT '',
623 `seen` boolean NOT NULL DEFAULT '0' COMMENT '',
624 `verb` varchar(100) NOT NULL DEFAULT '' COMMENT '',
625 `otype` varchar(10) NOT NULL DEFAULT '' COMMENT '',
626 `name_cache` tinytext COMMENT '',
627 `msg_cache` mediumtext COMMENT '',
629 INDEX `hash_uid` (`hash`,`uid`),
630 INDEX `seen_uid_date` (`seen`,`uid`,`date`),
631 INDEX `uid_date` (`uid`,`date`),
632 INDEX `uid_type_link` (`uid`,`type`,`link`(190))
633 ) DEFAULT COLLATE utf8mb4_general_ci;
636 -- TABLE notify-threads
638 CREATE TABLE IF NOT EXISTS `notify-threads` (
639 `id` int unsigned NOT NULL auto_increment COMMENT '',
640 `notify-id` int unsigned NOT NULL DEFAULT 0 COMMENT '',
641 `master-parent-item` int unsigned NOT NULL DEFAULT 0 COMMENT '',
642 `parent-item` int unsigned NOT NULL DEFAULT 0 COMMENT '',
643 `receiver-uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
645 ) DEFAULT COLLATE utf8mb4_general_ci;
650 CREATE TABLE IF NOT EXISTS `oembed` (
651 `url` varbinary(255) NOT NULL COMMENT '',
652 `maxwidth` mediumint unsigned NOT NULL COMMENT '',
653 `content` mediumtext COMMENT '',
654 `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
655 PRIMARY KEY(`url`,`maxwidth`),
656 INDEX `created` (`created`)
657 ) DEFAULT COLLATE utf8mb4_general_ci;
662 CREATE TABLE IF NOT EXISTS `parsed_url` (
663 `url` varbinary(255) NOT NULL COMMENT '',
664 `guessing` boolean NOT NULL DEFAULT '0' COMMENT '',
665 `oembed` boolean NOT NULL DEFAULT '0' COMMENT '',
666 `content` mediumtext COMMENT '',
667 `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
668 PRIMARY KEY(`url`,`guessing`,`oembed`),
669 INDEX `created` (`created`)
670 ) DEFAULT COLLATE utf8mb4_general_ci;
673 -- TABLE participation
675 CREATE TABLE IF NOT EXISTS `participation` (
676 `iid` int unsigned NOT NULL COMMENT '',
677 `server` varchar(60) NOT NULL COMMENT '',
678 `cid` int unsigned NOT NULL COMMENT '',
679 `fid` int unsigned NOT NULL COMMENT '',
680 PRIMARY KEY(`iid`,`server`)
681 ) DEFAULT COLLATE utf8mb4_general_ci;
686 CREATE TABLE IF NOT EXISTS `pconfig` (
687 `id` int unsigned NOT NULL auto_increment COMMENT '',
688 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
689 `cat` varbinary(50) NOT NULL DEFAULT '' COMMENT '',
690 `k` varbinary(100) NOT NULL DEFAULT '' COMMENT '',
691 `v` mediumtext COMMENT '',
693 UNIQUE INDEX `uid_cat_k` (`uid`,`cat`,`k`)
694 ) DEFAULT COLLATE utf8mb4_general_ci;
699 CREATE TABLE IF NOT EXISTS `photo` (
700 `id` int unsigned NOT NULL auto_increment COMMENT '',
701 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
702 `contact-id` int unsigned NOT NULL DEFAULT 0 COMMENT '',
703 `guid` char(16) NOT NULL DEFAULT '' COMMENT '',
704 `resource-id` char(32) NOT NULL DEFAULT '' COMMENT '',
705 `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
706 `edited` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
707 `title` varchar(255) NOT NULL DEFAULT '' COMMENT '',
708 `desc` text COMMENT '',
709 `album` varchar(255) NOT NULL DEFAULT '' COMMENT '',
710 `filename` varchar(255) NOT NULL DEFAULT '' COMMENT '',
711 `type` varchar(30) NOT NULL DEFAULT 'image/jpeg',
712 `height` smallint unsigned NOT NULL DEFAULT 0 COMMENT '',
713 `width` smallint unsigned NOT NULL DEFAULT 0 COMMENT '',
714 `datasize` int unsigned NOT NULL DEFAULT 0 COMMENT '',
715 `data` mediumblob NOT NULL COMMENT '',
716 `scale` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
717 `profile` boolean NOT NULL DEFAULT '0' COMMENT '',
718 `allow_cid` mediumtext COMMENT '',
719 `allow_gid` mediumtext COMMENT '',
720 `deny_cid` mediumtext COMMENT '',
721 `deny_gid` mediumtext COMMENT '',
723 INDEX `contactid` (`contact-id`),
724 INDEX `uid_contactid` (`uid`,`contact-id`),
725 INDEX `uid_profile` (`uid`,`profile`),
726 INDEX `uid_album_scale_created` (`uid`,`album`(32),`scale`,`created`),
727 INDEX `uid_album_resource-id_created` (`uid`,`album`(32),`resource-id`,`created`),
728 INDEX `resource-id` (`resource-id`)
729 ) DEFAULT COLLATE utf8mb4_general_ci;
734 CREATE TABLE IF NOT EXISTS `poll` (
735 `id` int unsigned NOT NULL auto_increment COMMENT '',
736 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
737 `q0` text COMMENT '',
738 `q1` text COMMENT '',
739 `q2` text COMMENT '',
740 `q3` text COMMENT '',
741 `q4` text COMMENT '',
742 `q5` text COMMENT '',
743 `q6` text COMMENT '',
744 `q7` text COMMENT '',
745 `q8` text COMMENT '',
746 `q9` text COMMENT '',
749 ) DEFAULT COLLATE utf8mb4_general_ci;
754 CREATE TABLE IF NOT EXISTS `poll_result` (
755 `id` int unsigned NOT NULL auto_increment COMMENT '',
756 `poll_id` int unsigned NOT NULL DEFAULT 0,
757 `choice` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
759 INDEX `poll_id` (`poll_id`)
760 ) DEFAULT COLLATE utf8mb4_general_ci;
765 CREATE TABLE IF NOT EXISTS `process` (
766 `pid` int unsigned NOT NULL COMMENT '',
767 `command` varbinary(32) NOT NULL DEFAULT '' COMMENT '',
768 `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
770 INDEX `command` (`command`)
771 ) DEFAULT COLLATE utf8mb4_general_ci;
776 CREATE TABLE IF NOT EXISTS `profile` (
777 `id` int unsigned NOT NULL auto_increment COMMENT '',
778 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
779 `profile-name` varchar(255) NOT NULL DEFAULT '' COMMENT '',
780 `is-default` boolean NOT NULL DEFAULT '0' COMMENT '',
781 `hide-friends` boolean NOT NULL DEFAULT '0' COMMENT '',
782 `name` varchar(255) NOT NULL DEFAULT '' COMMENT '',
783 `pdesc` varchar(255) NOT NULL DEFAULT '' COMMENT '',
784 `dob` varchar(32) NOT NULL DEFAULT '0000-00-00' COMMENT '',
785 `address` varchar(255) NOT NULL DEFAULT '' COMMENT '',
786 `locality` varchar(255) NOT NULL DEFAULT '' COMMENT '',
787 `region` varchar(255) NOT NULL DEFAULT '' COMMENT '',
788 `postal-code` varchar(32) NOT NULL DEFAULT '' COMMENT '',
789 `country-name` varchar(255) NOT NULL DEFAULT '' COMMENT '',
790 `hometown` varchar(255) NOT NULL DEFAULT '' COMMENT '',
791 `gender` varchar(32) NOT NULL DEFAULT '' COMMENT '',
792 `marital` varchar(255) NOT NULL DEFAULT '' COMMENT '',
793 `with` text COMMENT '',
794 `howlong` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
795 `sexual` varchar(255) NOT NULL DEFAULT '' COMMENT '',
796 `politic` varchar(255) NOT NULL DEFAULT '' COMMENT '',
797 `religion` varchar(255) NOT NULL DEFAULT '' COMMENT '',
798 `pub_keywords` text COMMENT '',
799 `prv_keywords` text COMMENT '',
800 `likes` text COMMENT '',
801 `dislikes` text COMMENT '',
802 `about` text COMMENT '',
803 `summary` varchar(255) NOT NULL DEFAULT '' COMMENT '',
804 `music` text COMMENT '',
805 `book` text COMMENT '',
806 `tv` text COMMENT '',
807 `film` text COMMENT '',
808 `interest` text COMMENT '',
809 `romance` text COMMENT '',
810 `work` text COMMENT '',
811 `education` text COMMENT '',
812 `contact` text COMMENT '',
813 `homepage` varchar(255) NOT NULL DEFAULT '' COMMENT '',
814 `xmpp` varchar(255) NOT NULL DEFAULT '' COMMENT '',
815 `photo` varchar(255) NOT NULL DEFAULT '' COMMENT '',
816 `thumb` varchar(255) NOT NULL DEFAULT '' COMMENT '',
817 `publish` boolean NOT NULL DEFAULT '0' COMMENT '',
818 `net-publish` boolean NOT NULL DEFAULT '0' COMMENT '',
820 INDEX `uid_is-default` (`uid`,`is-default`)
821 ) DEFAULT COLLATE utf8mb4_general_ci;
824 -- TABLE profile_check
826 CREATE TABLE IF NOT EXISTS `profile_check` (
827 `id` int unsigned NOT NULL auto_increment COMMENT '',
828 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
829 `cid` int unsigned NOT NULL DEFAULT 0 COMMENT '',
830 `dfrn_id` varchar(255) NOT NULL DEFAULT '' COMMENT '',
831 `sec` varchar(255) NOT NULL DEFAULT '' COMMENT '',
832 `expire` int unsigned NOT NULL DEFAULT 0 COMMENT '',
834 ) DEFAULT COLLATE utf8mb4_general_ci;
837 -- TABLE push_subscriber
839 CREATE TABLE IF NOT EXISTS `push_subscriber` (
840 `id` int unsigned NOT NULL auto_increment COMMENT '',
841 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
842 `callback_url` varchar(255) NOT NULL DEFAULT '' COMMENT '',
843 `topic` varchar(255) NOT NULL DEFAULT '' COMMENT '',
844 `nickname` varchar(255) NOT NULL DEFAULT '' COMMENT '',
845 `push` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
846 `last_update` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
847 `secret` varchar(255) NOT NULL DEFAULT '' COMMENT '',
849 ) DEFAULT COLLATE utf8mb4_general_ci;
854 CREATE TABLE IF NOT EXISTS `queue` (
855 `id` int unsigned NOT NULL auto_increment COMMENT '',
856 `cid` int unsigned NOT NULL DEFAULT 0 COMMENT 'Message receiver',
857 `network` char(4) NOT NULL DEFAULT '' COMMENT 'Receiver\'s network',
858 `guid` varchar(255) NOT NULL DEFAULT '' COMMENT 'Unique GUID of the message',
859 `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Date, when the message was created',
860 `last` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Date of last trial',
861 `next` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Next retrial date',
862 `retrial` tinyint NOT NULL DEFAULT 0 COMMENT 'Retrial counter',
863 `content` mediumtext COMMENT '',
864 `batch` boolean NOT NULL DEFAULT '0' COMMENT '',
866 INDEX `last` (`last`),
867 INDEX `next` (`next`)
868 ) DEFAULT COLLATE utf8mb4_general_ci;
873 CREATE TABLE IF NOT EXISTS `register` (
874 `id` int unsigned NOT NULL auto_increment COMMENT '',
875 `hash` varchar(255) NOT NULL DEFAULT '' COMMENT '',
876 `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
877 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
878 `password` varchar(255) NOT NULL DEFAULT '' COMMENT '',
879 `language` varchar(16) NOT NULL DEFAULT '' COMMENT '',
880 `note` text COMMENT '',
882 ) DEFAULT COLLATE utf8mb4_general_ci;
887 CREATE TABLE IF NOT EXISTS `search` (
888 `id` int unsigned NOT NULL auto_increment COMMENT '',
889 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
890 `term` varchar(255) NOT NULL DEFAULT '' COMMENT '',
893 ) DEFAULT COLLATE utf8mb4_general_ci;
898 CREATE TABLE IF NOT EXISTS `session` (
899 `id` bigint unsigned NOT NULL auto_increment COMMENT '',
900 `sid` varbinary(255) NOT NULL DEFAULT '' COMMENT '',
901 `data` text COMMENT '',
902 `expire` int unsigned NOT NULL DEFAULT 0 COMMENT '',
904 INDEX `sid` (`sid`(64)),
905 INDEX `expire` (`expire`)
906 ) DEFAULT COLLATE utf8mb4_general_ci;
911 CREATE TABLE IF NOT EXISTS `sign` (
912 `id` int unsigned NOT NULL auto_increment COMMENT '',
913 `iid` int unsigned NOT NULL DEFAULT 0 COMMENT '',
914 `signed_text` mediumtext COMMENT '',
915 `signature` text COMMENT '',
916 `signer` varchar(255) NOT NULL DEFAULT '' COMMENT '',
918 UNIQUE INDEX `iid` (`iid`)
919 ) DEFAULT COLLATE utf8mb4_general_ci;
924 CREATE TABLE IF NOT EXISTS `term` (
925 `tid` int unsigned NOT NULL auto_increment COMMENT '',
926 `oid` int unsigned NOT NULL DEFAULT 0 COMMENT '',
927 `otype` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
928 `type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
929 `term` varchar(255) NOT NULL DEFAULT '' COMMENT '',
930 `url` varchar(255) NOT NULL DEFAULT '' COMMENT '',
931 `guid` varchar(255) NOT NULL DEFAULT '' COMMENT '',
932 `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
933 `received` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
934 `global` boolean NOT NULL DEFAULT '0' COMMENT '',
935 `aid` int unsigned NOT NULL DEFAULT 0 COMMENT '',
936 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
938 INDEX `oid_otype_type_term` (`oid`,`otype`,`type`,`term`(32)),
939 INDEX `uid_otype_type_term_global_created` (`uid`,`otype`,`type`,`term`(32),`global`,`created`),
940 INDEX `uid_otype_type_url` (`uid`,`otype`,`type`,`url`(64)),
941 INDEX `guid` (`guid`(64))
942 ) DEFAULT COLLATE utf8mb4_general_ci;
947 CREATE TABLE IF NOT EXISTS `thread` (
948 `iid` int unsigned NOT NULL DEFAULT 0 COMMENT '',
949 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
950 `contact-id` int unsigned NOT NULL DEFAULT 0 COMMENT '',
951 `owner-id` int unsigned NOT NULL DEFAULT 0 COMMENT '',
952 `author-id` int unsigned NOT NULL DEFAULT 0 COMMENT '',
953 `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
954 `edited` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
955 `commented` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
956 `received` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
957 `changed` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
958 `wall` boolean NOT NULL DEFAULT '0' COMMENT '',
959 `private` boolean NOT NULL DEFAULT '0' COMMENT '',
960 `pubmail` boolean NOT NULL DEFAULT '0' COMMENT '',
961 `moderated` boolean NOT NULL DEFAULT '0' COMMENT '',
962 `visible` boolean NOT NULL DEFAULT '0' COMMENT '',
963 `spam` boolean NOT NULL DEFAULT '0' COMMENT '',
964 `starred` boolean NOT NULL DEFAULT '0' COMMENT '',
965 `ignored` boolean NOT NULL DEFAULT '0' COMMENT '',
966 `bookmark` boolean NOT NULL DEFAULT '0' COMMENT '',
967 `unseen` boolean NOT NULL DEFAULT '1' COMMENT '',
968 `deleted` boolean NOT NULL DEFAULT '0' COMMENT '',
969 `origin` boolean NOT NULL DEFAULT '0' COMMENT '',
970 `forum_mode` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
971 `mention` boolean NOT NULL DEFAULT '0' COMMENT '',
972 `network` char(4) NOT NULL DEFAULT '' COMMENT '',
974 INDEX `uid_network_commented` (`uid`,`network`,`commented`),
975 INDEX `uid_network_created` (`uid`,`network`,`created`),
976 INDEX `uid_contactid_commented` (`uid`,`contact-id`,`commented`),
977 INDEX `uid_contactid_created` (`uid`,`contact-id`,`created`),
978 INDEX `contactid` (`contact-id`),
979 INDEX `ownerid` (`owner-id`),
980 INDEX `authorid` (`author-id`),
981 INDEX `uid_created` (`uid`,`created`),
982 INDEX `uid_commented` (`uid`,`commented`),
983 INDEX `uid_wall_created` (`uid`,`wall`,`created`),
984 INDEX `private_wall_origin_commented` (`private`,`wall`,`origin`,`commented`)
985 ) DEFAULT COLLATE utf8mb4_general_ci;
990 CREATE TABLE IF NOT EXISTS `tokens` (
991 `id` varchar(40) NOT NULL COMMENT '',
992 `secret` text COMMENT '',
993 `client_id` varchar(20) NOT NULL DEFAULT '',
994 `expires` int NOT NULL DEFAULT 0 COMMENT '',
995 `scope` varchar(200) NOT NULL DEFAULT '' COMMENT '',
996 `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
998 ) DEFAULT COLLATE utf8mb4_general_ci;
1003 CREATE TABLE IF NOT EXISTS `user` (
1004 `uid` mediumint unsigned NOT NULL auto_increment COMMENT '',
1005 `parent-uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'The parent user that has full control about this user',
1006 `guid` varchar(64) NOT NULL DEFAULT '' COMMENT '',
1007 `username` varchar(255) NOT NULL DEFAULT '' COMMENT '',
1008 `password` varchar(255) NOT NULL DEFAULT '' COMMENT '',
1009 `legacy_password` boolean NOT NULL DEFAULT '0' COMMENT 'Is the password hash double-hashed?',
1010 `nickname` varchar(255) NOT NULL DEFAULT '' COMMENT '',
1011 `email` varchar(255) NOT NULL DEFAULT '' COMMENT '',
1012 `openid` varchar(255) NOT NULL DEFAULT '' COMMENT '',
1013 `timezone` varchar(128) NOT NULL DEFAULT '' COMMENT '',
1014 `language` varchar(32) NOT NULL DEFAULT 'en' COMMENT '',
1015 `register_date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
1016 `login_date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
1017 `default-location` varchar(255) NOT NULL DEFAULT '' COMMENT '',
1018 `allow_location` boolean NOT NULL DEFAULT '0' COMMENT '',
1019 `theme` varchar(255) NOT NULL DEFAULT '' COMMENT '',
1020 `pubkey` text COMMENT '',
1021 `prvkey` text COMMENT '',
1022 `spubkey` text COMMENT '',
1023 `sprvkey` text COMMENT '',
1024 `verified` boolean NOT NULL DEFAULT '0' COMMENT '',
1025 `blocked` boolean NOT NULL DEFAULT '0' COMMENT '',
1026 `blockwall` boolean NOT NULL DEFAULT '0' COMMENT '',
1027 `hidewall` boolean NOT NULL DEFAULT '0' COMMENT '',
1028 `blocktags` boolean NOT NULL DEFAULT '0' COMMENT '',
1029 `unkmail` boolean NOT NULL DEFAULT '0' COMMENT '',
1030 `cntunkmail` int unsigned NOT NULL DEFAULT 10 COMMENT '',
1031 `notify-flags` smallint unsigned NOT NULL DEFAULT 65535 COMMENT '',
1032 `page-flags` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
1033 `account-type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
1034 `prvnets` boolean NOT NULL DEFAULT '0' COMMENT '',
1035 `pwdreset` varchar(255) COMMENT 'Password reset request token',
1036 `pwdreset_time` datetime COMMENT 'Timestamp of the last password reset request',
1037 `maxreq` int unsigned NOT NULL DEFAULT 10 COMMENT '',
1038 `expire` int unsigned NOT NULL DEFAULT 0 COMMENT '',
1039 `account_removed` boolean NOT NULL DEFAULT '0' COMMENT '',
1040 `account_expired` boolean NOT NULL DEFAULT '0' COMMENT '',
1041 `account_expires_on` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
1042 `expire_notification_sent` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
1043 `def_gid` int unsigned NOT NULL DEFAULT 0 COMMENT '',
1044 `allow_cid` mediumtext COMMENT '',
1045 `allow_gid` mediumtext COMMENT '',
1046 `deny_cid` mediumtext COMMENT '',
1047 `deny_gid` mediumtext COMMENT '',
1048 `openidserver` text COMMENT '',
1050 INDEX `nickname` (`nickname`(32))
1051 ) DEFAULT COLLATE utf8mb4_general_ci;
1056 CREATE TABLE IF NOT EXISTS `userd` (
1057 `id` int unsigned NOT NULL auto_increment COMMENT '',
1058 `username` varchar(255) NOT NULL COMMENT '',
1060 INDEX `username` (`username`(32))
1061 ) DEFAULT COLLATE utf8mb4_general_ci;
1064 -- TABLE workerqueue
1066 CREATE TABLE IF NOT EXISTS `workerqueue` (
1067 `id` int unsigned NOT NULL auto_increment COMMENT 'Auto incremented worker task id',
1068 `parameter` mediumblob COMMENT 'Task command',
1069 `priority` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'Task priority',
1070 `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Creation date',
1071 `pid` int unsigned NOT NULL DEFAULT 0 COMMENT 'Process id of the worker',
1072 `executed` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Execution date',
1073 `done` boolean NOT NULL DEFAULT '0' COMMENT 'Marked when the task was done, will be deleted later',
1075 INDEX `pid` (`pid`),
1076 INDEX `parameter` (`parameter`(64)),
1077 INDEX `priority_created` (`priority`,`created`),
1078 INDEX `executed` (`executed`)
1079 ) DEFAULT COLLATE utf8mb4_general_ci;