1 -- ------------------------------------------
2 -- Friendica 3.6-dev (Asparagus)
3 -- DB_UPDATE_VERSION 1242
4 -- ------------------------------------------
10 CREATE TABLE IF NOT EXISTS `addon` (
11 `id` int NOT NULL auto_increment COMMENT '',
12 `name` varchar(190) NOT NULL DEFAULT '' COMMENT '',
13 `version` varchar(255) NOT NULL DEFAULT '' COMMENT '',
14 `installed` boolean NOT NULL DEFAULT '0' COMMENT '',
15 `hidden` boolean NOT NULL DEFAULT '0' COMMENT '',
16 `timestamp` bigint 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 NOT NULL auto_increment COMMENT '',
27 `uid` mediumint 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 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 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 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 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 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 NOT NULL auto_increment COMMENT '',
97 `cat` varbinary(255) NOT NULL DEFAULT '' COMMENT '',
98 `k` varbinary(255) 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 NOT NULL auto_increment COMMENT '',
109 `uid` mediumint 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 NOT NULL DEFAULT 0 COMMENT '',
114 `duplex` boolean NOT NULL DEFAULT '0' COMMENT '',
115 `network` varchar(255) 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` text COMMENT '',
126 `thumb` text COMMENT '',
127 `micro` text 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` text COMMENT '',
139 `notify` text COMMENT '',
140 `poll` text COMMENT '',
141 `confirm` text COMMENT '',
142 `poco` text 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 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 NOT NULL DEFAULT 99 COMMENT '',
169 `info` mediumtext COMMENT '',
170 `profile-id` int 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 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`(4),`poll`(64),`archive`),
183 INDEX `uid_network_batch` (`uid`,`network`(4),`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 NOT NULL auto_increment COMMENT '',
196 `guid` varchar(255) NOT NULL DEFAULT '' COMMENT '',
197 `recips` text COMMENT '',
198 `uid` mediumint 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 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 NOT NULL auto_increment COMMENT '',
228 `guid` varchar(255) NOT NULL DEFAULT '' COMMENT '',
229 `uid` mediumint NOT NULL DEFAULT 0 COMMENT 'User id',
230 `cid` int 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(255) 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 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 NOT NULL DEFAULT 0 COMMENT '',
268 `network` varchar(32) 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 NOT NULL auto_increment COMMENT '',
282 `uid` mediumint NOT NULL DEFAULT 0 COMMENT 'User id',
283 `cid` int 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 NOT NULL auto_increment COMMENT '',
298 `uid` mediumint NOT NULL DEFAULT 0 COMMENT 'User id',
299 `gcid` int 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 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` varchar(255) NOT NULL DEFAULT '' COMMENT '',
330 `addr` varchar(255) NOT NULL DEFAULT '' COMMENT '',
331 `notify` text COMMENT '',
332 `alias` varchar(255) NOT NULL DEFAULT '' COMMENT '',
333 `generation` tinyint 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`(4),`updated`),
341 INDEX `updated` (`updated`)
342 ) DEFAULT COLLATE utf8mb4_general_ci;
347 CREATE TABLE IF NOT EXISTS `glink` (
348 `id` int NOT NULL auto_increment COMMENT '',
349 `cid` int NOT NULL DEFAULT 0 COMMENT '',
350 `uid` mediumint NOT NULL DEFAULT 0 COMMENT 'User id',
351 `gcid` int NOT NULL DEFAULT 0 COMMENT '',
352 `zcid` int 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 NOT NULL auto_increment COMMENT '',
364 `uid` mediumint 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 NOT NULL auto_increment COMMENT '',
377 `gid` int NOT NULL DEFAULT 0 COMMENT '',
378 `contact-id` int 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 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 NOT NULL DEFAULT 0 COMMENT '',
396 `poco` varchar(255) NOT NULL DEFAULT '' COMMENT '',
397 `noscrape` varchar(255) NOT NULL DEFAULT '' COMMENT '',
398 `network` varchar(32) 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 NOT NULL auto_increment COMMENT '',
413 `hook` varchar(255) NOT NULL DEFAULT '' COMMENT '',
414 `file` varchar(255) NOT NULL DEFAULT '' COMMENT '',
415 `function` varchar(255) NOT NULL DEFAULT '' COMMENT '',
416 `priority` smallint NOT NULL DEFAULT 0 COMMENT '',
418 UNIQUE INDEX `hook_file_function` (`hook`(50),`file`(80),`function`(60))
419 ) DEFAULT COLLATE utf8mb4_general_ci;
424 CREATE TABLE IF NOT EXISTS `intro` (
425 `id` int NOT NULL auto_increment COMMENT '',
426 `uid` mediumint NOT NULL DEFAULT 0 COMMENT 'User id',
427 `fid` int NOT NULL DEFAULT 0 COMMENT '',
428 `contact-id` int 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 NOT NULL auto_increment,
444 `guid` varchar(255) NOT NULL DEFAULT '' COMMENT '',
445 `uri` varchar(255) NOT NULL DEFAULT '' COMMENT '',
446 `uid` mediumint NOT NULL DEFAULT 0 COMMENT 'User id',
447 `contact-id` int NOT NULL DEFAULT 0 COMMENT '',
448 `gcontact-id` int NOT NULL DEFAULT 0 COMMENT '',
449 `type` varchar(255) NOT NULL DEFAULT '' COMMENT '',
450 `wall` boolean NOT NULL DEFAULT '0' COMMENT '',
451 `gravity` tinyint NOT NULL DEFAULT 0 COMMENT '',
452 `parent` int NOT NULL DEFAULT 0 COMMENT '',
453 `parent-uri` varchar(255) NOT NULL DEFAULT '' COMMENT '',
454 `extid` varchar(255) NOT NULL DEFAULT '' COMMENT '',
455 `thr-parent` varchar(255) NOT NULL DEFAULT '' COMMENT '',
456 `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
457 `edited` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
458 `commented` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
459 `received` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
460 `changed` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
461 `owner-id` int NOT NULL DEFAULT 0 COMMENT '',
462 `owner-name` varchar(255) NOT NULL DEFAULT '' COMMENT '',
463 `owner-link` varchar(255) NOT NULL DEFAULT '' COMMENT '',
464 `owner-avatar` varchar(255) NOT NULL DEFAULT '' COMMENT '',
465 `author-id` int NOT NULL DEFAULT 0 COMMENT '',
466 `author-name` varchar(255) NOT NULL DEFAULT '' COMMENT '',
467 `author-link` varchar(255) NOT NULL DEFAULT '' COMMENT '',
468 `author-avatar` varchar(255) NOT NULL DEFAULT '' COMMENT '',
469 `title` varchar(255) NOT NULL DEFAULT '' COMMENT '',
470 `body` mediumtext COMMENT '',
471 `app` varchar(255) NOT NULL DEFAULT '' COMMENT '',
472 `verb` varchar(255) NOT NULL DEFAULT '' COMMENT '',
473 `object-type` varchar(255) NOT NULL DEFAULT '' COMMENT '',
474 `object` text COMMENT '',
475 `target-type` varchar(255) NOT NULL DEFAULT '' COMMENT '',
476 `target` text COMMENT '',
477 `postopts` text COMMENT '',
478 `plink` varchar(255) NOT NULL DEFAULT '' COMMENT '',
479 `resource-id` varchar(255) NOT NULL DEFAULT '' COMMENT '',
480 `event-id` int NOT NULL DEFAULT 0 COMMENT '',
481 `tag` mediumtext COMMENT '',
482 `attach` mediumtext COMMENT '',
483 `inform` mediumtext COMMENT '',
484 `file` mediumtext COMMENT '',
485 `location` varchar(255) NOT NULL DEFAULT '' COMMENT '',
486 `coord` varchar(255) NOT NULL DEFAULT '' COMMENT '',
487 `allow_cid` mediumtext COMMENT '',
488 `allow_gid` mediumtext COMMENT '',
489 `deny_cid` mediumtext COMMENT '',
490 `deny_gid` mediumtext COMMENT '',
491 `private` boolean NOT NULL DEFAULT '0' COMMENT '',
492 `pubmail` boolean NOT NULL DEFAULT '0' COMMENT '',
493 `moderated` boolean NOT NULL DEFAULT '0' COMMENT '',
494 `visible` boolean NOT NULL DEFAULT '0' COMMENT '',
495 `spam` boolean NOT NULL DEFAULT '0' COMMENT '',
496 `starred` boolean NOT NULL DEFAULT '0' COMMENT '',
497 `bookmark` boolean NOT NULL DEFAULT '0' COMMENT '',
498 `unseen` boolean NOT NULL DEFAULT '1' COMMENT '',
499 `deleted` boolean NOT NULL DEFAULT '0' COMMENT '',
500 `origin` boolean NOT NULL DEFAULT '0' COMMENT '',
501 `forum_mode` tinyint NOT NULL DEFAULT 0 COMMENT '',
502 `mention` boolean NOT NULL DEFAULT '0' COMMENT '',
503 `network` varchar(32) NOT NULL DEFAULT '' COMMENT '',
504 `rendered-hash` varchar(32) NOT NULL DEFAULT '' COMMENT '',
505 `rendered-html` mediumtext COMMENT '',
506 `global` boolean NOT NULL DEFAULT '0' COMMENT '',
508 INDEX `guid` (`guid`(191)),
509 INDEX `uri` (`uri`(191)),
510 INDEX `parent` (`parent`),
511 INDEX `parent-uri` (`parent-uri`(191)),
512 INDEX `extid` (`extid`(191)),
513 INDEX `uid_id` (`uid`,`id`),
514 INDEX `uid_contactid_id` (`uid`,`contact-id`,`id`),
515 INDEX `uid_created` (`uid`,`created`),
516 INDEX `uid_unseen_contactid` (`uid`,`unseen`,`contact-id`),
517 INDEX `uid_network_received` (`uid`,`network`(4),`received`),
518 INDEX `uid_network_commented` (`uid`,`network`(4),`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`(191)),
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`(190),`changed`),
528 INDEX `contactid_verb` (`contact-id`,`verb`(190)),
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 NOT NULL auto_increment COMMENT '',
541 `name` varchar(128) NOT NULL DEFAULT '' COMMENT '',
542 `locked` boolean NOT NULL DEFAULT '0' COMMENT '',
543 `pid` int NOT NULL DEFAULT 0 COMMENT '',
545 ) DEFAULT COLLATE utf8mb4_general_ci;
550 CREATE TABLE IF NOT EXISTS `mail` (
551 `id` int NOT NULL auto_increment COMMENT '',
552 `uid` mediumint 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 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 NOT NULL auto_increment COMMENT '',
581 `uid` mediumint 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 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 NOT NULL auto_increment COMMENT '',
601 `uid` mediumint NOT NULL DEFAULT 0 COMMENT 'User id',
602 `mid` mediumint 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 NOT NULL auto_increment COMMENT '',
612 `hash` varchar(64) NOT NULL DEFAULT '' COMMENT '',
613 `type` smallint 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 NOT NULL DEFAULT 0 COMMENT 'User id',
620 `link` varchar(255) NOT NULL DEFAULT '' COMMENT '',
621 `iid` int NOT NULL DEFAULT 0 COMMENT '',
622 `parent` int NOT NULL DEFAULT 0 COMMENT '',
623 `seen` boolean NOT NULL DEFAULT '0' COMMENT '',
624 `verb` varchar(255) NOT NULL DEFAULT '' COMMENT '',
625 `otype` varchar(16) 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 NOT NULL auto_increment COMMENT '',
640 `notify-id` int NOT NULL DEFAULT 0 COMMENT '',
641 `master-parent-item` int NOT NULL DEFAULT 0 COMMENT '',
642 `parent-item` int NOT NULL DEFAULT 0 COMMENT '',
643 `receiver-uid` mediumint 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 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 NOT NULL COMMENT '',
677 `server` varchar(60) NOT NULL COMMENT '',
678 `cid` int NOT NULL COMMENT '',
679 `fid` int NOT NULL COMMENT '',
680 PRIMARY KEY(`iid`,`server`)
681 ) DEFAULT COLLATE utf8mb4_general_ci;
686 CREATE TABLE IF NOT EXISTS `pconfig` (
687 `id` int NOT NULL auto_increment COMMENT '',
688 `uid` mediumint NOT NULL DEFAULT 0 COMMENT 'User id',
689 `cat` varbinary(255) NOT NULL DEFAULT '' COMMENT '',
690 `k` varbinary(255) 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 NOT NULL auto_increment COMMENT '',
701 `uid` mediumint NOT NULL DEFAULT 0 COMMENT 'User id',
702 `contact-id` int NOT NULL DEFAULT 0 COMMENT '',
703 `guid` varchar(64) NOT NULL DEFAULT '' COMMENT '',
704 `resource-id` varchar(255) 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(128) NOT NULL DEFAULT 'image/jpeg',
712 `height` smallint NOT NULL DEFAULT 0 COMMENT '',
713 `width` smallint NOT NULL DEFAULT 0 COMMENT '',
714 `datasize` int NOT NULL DEFAULT 0 COMMENT '',
715 `data` mediumblob NOT NULL COMMENT '',
716 `scale` tinyint 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`(64),`created`),
728 INDEX `resource-id` (`resource-id`(64))
729 ) DEFAULT COLLATE utf8mb4_general_ci;
734 CREATE TABLE IF NOT EXISTS `poll` (
735 `id` int NOT NULL auto_increment COMMENT '',
736 `uid` mediumint 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 NOT NULL auto_increment COMMENT '',
756 `poll_id` int NOT NULL DEFAULT 0,
757 `choice` tinyint 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 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 NOT NULL auto_increment COMMENT '',
778 `uid` mediumint 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 '0001-01-01' 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 NOT NULL auto_increment COMMENT '',
828 `uid` mediumint NOT NULL DEFAULT 0 COMMENT 'User id',
829 `cid` int 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 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 NOT NULL auto_increment COMMENT '',
841 `uid` mediumint 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 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 NOT NULL auto_increment COMMENT '',
856 `cid` int NOT NULL DEFAULT 0 COMMENT '',
857 `network` varchar(32) NOT NULL DEFAULT '' COMMENT '',
858 `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
859 `last` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
860 `content` mediumtext COMMENT '',
861 `batch` boolean NOT NULL DEFAULT '0' COMMENT '',
864 INDEX `created` (`created`),
865 INDEX `last` (`last`),
866 INDEX `network` (`network`),
867 INDEX `batch` (`batch`)
868 ) DEFAULT COLLATE utf8mb4_general_ci;
873 CREATE TABLE IF NOT EXISTS `register` (
874 `id` int 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 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 NOT NULL auto_increment COMMENT '',
889 `uid` mediumint 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 NOT NULL auto_increment COMMENT '',
900 `sid` varbinary(255) NOT NULL DEFAULT '' COMMENT '',
901 `data` text COMMENT '',
902 `expire` int 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 NOT NULL auto_increment COMMENT '',
913 `iid` int 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 NOT NULL auto_increment COMMENT '',
926 `oid` int NOT NULL DEFAULT 0 COMMENT '',
927 `otype` tinyint NOT NULL DEFAULT 0 COMMENT '',
928 `type` tinyint 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 NOT NULL DEFAULT 0 COMMENT '',
936 `uid` mediumint 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 NOT NULL DEFAULT 0 COMMENT '',
949 `uid` mediumint NOT NULL DEFAULT 0 COMMENT 'User id',
950 `contact-id` int NOT NULL DEFAULT 0 COMMENT '',
951 `gcontact-id` int NOT NULL DEFAULT 0 COMMENT '',
952 `owner-id` int NOT NULL DEFAULT 0 COMMENT '',
953 `author-id` int NOT NULL DEFAULT 0 COMMENT '',
954 `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
955 `edited` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
956 `commented` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
957 `received` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
958 `changed` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
959 `wall` boolean NOT NULL DEFAULT '0' COMMENT '',
960 `private` boolean NOT NULL DEFAULT '0' COMMENT '',
961 `pubmail` boolean NOT NULL DEFAULT '0' COMMENT '',
962 `moderated` boolean NOT NULL DEFAULT '0' COMMENT '',
963 `visible` boolean NOT NULL DEFAULT '0' COMMENT '',
964 `spam` boolean NOT NULL DEFAULT '0' COMMENT '',
965 `starred` boolean NOT NULL DEFAULT '0' COMMENT '',
966 `ignored` boolean NOT NULL DEFAULT '0' COMMENT '',
967 `bookmark` boolean NOT NULL DEFAULT '0' COMMENT '',
968 `unseen` boolean NOT NULL DEFAULT '1' COMMENT '',
969 `deleted` boolean NOT NULL DEFAULT '0' COMMENT '',
970 `origin` boolean NOT NULL DEFAULT '0' COMMENT '',
971 `forum_mode` tinyint NOT NULL DEFAULT 0 COMMENT '',
972 `mention` boolean NOT NULL DEFAULT '0' COMMENT '',
973 `network` varchar(32) NOT NULL DEFAULT '' COMMENT '',
975 INDEX `uid_network_commented` (`uid`,`network`,`commented`),
976 INDEX `uid_network_created` (`uid`,`network`,`created`),
977 INDEX `uid_contactid_commented` (`uid`,`contact-id`,`commented`),
978 INDEX `uid_contactid_created` (`uid`,`contact-id`,`created`),
979 INDEX `contactid` (`contact-id`),
980 INDEX `ownerid` (`owner-id`),
981 INDEX `authorid` (`author-id`),
982 INDEX `uid_created` (`uid`,`created`),
983 INDEX `uid_commented` (`uid`,`commented`),
984 INDEX `uid_wall_created` (`uid`,`wall`,`created`),
985 INDEX `private_wall_commented` (`private`,`wall`,`commented`)
986 ) DEFAULT COLLATE utf8mb4_general_ci;
991 CREATE TABLE IF NOT EXISTS `tokens` (
992 `id` varchar(40) NOT NULL COMMENT '',
993 `secret` text COMMENT '',
994 `client_id` varchar(20) NOT NULL DEFAULT '',
995 `expires` int NOT NULL DEFAULT 0 COMMENT '',
996 `scope` varchar(200) NOT NULL DEFAULT '' COMMENT '',
997 `uid` mediumint NOT NULL DEFAULT 0 COMMENT 'User id',
999 ) DEFAULT COLLATE utf8mb4_general_ci;
1004 CREATE TABLE IF NOT EXISTS `user` (
1005 `uid` mediumint NOT NULL auto_increment COMMENT '',
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 `nickname` varchar(255) NOT NULL DEFAULT '' COMMENT '',
1010 `email` varchar(255) NOT NULL DEFAULT '' COMMENT '',
1011 `openid` varchar(255) NOT NULL DEFAULT '' COMMENT '',
1012 `timezone` varchar(128) NOT NULL DEFAULT '' COMMENT '',
1013 `language` varchar(32) NOT NULL DEFAULT 'en' COMMENT '',
1014 `register_date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
1015 `login_date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
1016 `default-location` varchar(255) NOT NULL DEFAULT '' COMMENT '',
1017 `allow_location` boolean NOT NULL DEFAULT '0' COMMENT '',
1018 `theme` varchar(255) NOT NULL DEFAULT '' COMMENT '',
1019 `pubkey` text COMMENT '',
1020 `prvkey` text COMMENT '',
1021 `spubkey` text COMMENT '',
1022 `sprvkey` text COMMENT '',
1023 `verified` boolean NOT NULL DEFAULT '0' COMMENT '',
1024 `blocked` boolean NOT NULL DEFAULT '0' COMMENT '',
1025 `blockwall` boolean NOT NULL DEFAULT '0' COMMENT '',
1026 `hidewall` boolean NOT NULL DEFAULT '0' COMMENT '',
1027 `blocktags` boolean NOT NULL DEFAULT '0' COMMENT '',
1028 `unkmail` boolean NOT NULL DEFAULT '0' COMMENT '',
1029 `cntunkmail` int NOT NULL DEFAULT 10 COMMENT '',
1030 `notify-flags` smallint unsigned NOT NULL DEFAULT 65535 COMMENT '',
1031 `page-flags` tinyint NOT NULL DEFAULT 0 COMMENT '',
1032 `account-type` tinyint NOT NULL DEFAULT 0 COMMENT '',
1033 `prvnets` boolean NOT NULL DEFAULT '0' COMMENT '',
1034 `pwdreset` varchar(255) NOT NULL DEFAULT '' COMMENT '',
1035 `maxreq` int NOT NULL DEFAULT 10 COMMENT '',
1036 `expire` int NOT NULL DEFAULT 0 COMMENT '',
1037 `account_removed` boolean NOT NULL DEFAULT '0' COMMENT '',
1038 `account_expired` boolean NOT NULL DEFAULT '0' COMMENT '',
1039 `account_expires_on` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
1040 `expire_notification_sent` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
1041 `def_gid` int NOT NULL DEFAULT 0 COMMENT '',
1042 `allow_cid` mediumtext COMMENT '',
1043 `allow_gid` mediumtext COMMENT '',
1044 `deny_cid` mediumtext COMMENT '',
1045 `deny_gid` mediumtext COMMENT '',
1046 `openidserver` text COMMENT '',
1048 INDEX `nickname` (`nickname`(32))
1049 ) DEFAULT COLLATE utf8mb4_general_ci;
1054 CREATE TABLE IF NOT EXISTS `userd` (
1055 `id` int NOT NULL auto_increment COMMENT '',
1056 `username` varchar(255) NOT NULL COMMENT '',
1058 INDEX `username` (`username`(32))
1059 ) DEFAULT COLLATE utf8mb4_general_ci;
1062 -- TABLE workerqueue
1064 CREATE TABLE IF NOT EXISTS `workerqueue` (
1065 `id` int NOT NULL auto_increment COMMENT 'Auto incremented worker task id',
1066 `parameter` text COMMENT 'Task command',
1067 `priority` tinyint NOT NULL DEFAULT 0 COMMENT 'Task priority',
1068 `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Creation date',
1069 `pid` int NOT NULL DEFAULT 0 COMMENT 'Process id of the worker',
1070 `executed` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Execution date',
1071 `done` boolean NOT NULL DEFAULT '0' COMMENT 'Marked when the task was done, will be deleted later',
1073 INDEX `pid` (`pid`),
1074 INDEX `parameter` (`parameter`(64)),
1075 INDEX `priority_created` (`priority`,`created`),
1076 INDEX `executed` (`executed`)
1077 ) DEFAULT COLLATE utf8mb4_general_ci;