Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1113 lines
36 KiB

4 years ago
11 years ago
11 years ago
11 years ago
11 years ago
6 years ago
11 years ago
11 years ago
11 years ago
  1. -- ------------------------------------------
  2. -- Friendica 3.5.2-dev (Asparagus)
  3. -- DB_UPDATE_VERSION 1221
  4. -- ------------------------------------------
  5. --
  6. -- TABLE addon
  7. --
  8. CREATE TABLE IF NOT EXISTS `addon` (
  9. `id` int(11) NOT NULL auto_increment,
  10. `name` varchar(190) NOT NULL DEFAULT '',
  11. `version` varchar(255) NOT NULL DEFAULT '',
  12. `installed` tinyint(1) NOT NULL DEFAULT 0,
  13. `hidden` tinyint(1) NOT NULL DEFAULT 0,
  14. `timestamp` bigint(20) NOT NULL DEFAULT 0,
  15. `plugin_admin` tinyint(1) NOT NULL DEFAULT 0,
  16. PRIMARY KEY(`id`),
  17. UNIQUE INDEX `name` (`name`)
  18. ) DEFAULT COLLATE utf8mb4_general_ci;
  19. --
  20. -- TABLE attach
  21. --
  22. CREATE TABLE IF NOT EXISTS `attach` (
  23. `id` int(11) NOT NULL auto_increment,
  24. `uid` int(11) NOT NULL DEFAULT 0,
  25. `hash` varchar(64) NOT NULL DEFAULT '',
  26. `filename` varchar(255) NOT NULL DEFAULT '',
  27. `filetype` varchar(64) NOT NULL DEFAULT '',
  28. `filesize` int(11) NOT NULL DEFAULT 0,
  29. `data` longblob NOT NULL,
  30. `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  31. `edited` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  32. `allow_cid` mediumtext,
  33. `allow_gid` mediumtext,
  34. `deny_cid` mediumtext,
  35. `deny_gid` mediumtext,
  36. PRIMARY KEY(`id`)
  37. ) DEFAULT COLLATE utf8mb4_general_ci;
  38. --
  39. -- TABLE auth_codes
  40. --
  41. CREATE TABLE IF NOT EXISTS `auth_codes` (
  42. `id` varchar(40) NOT NULL,
  43. `client_id` varchar(20) NOT NULL DEFAULT '',
  44. `redirect_uri` varchar(200) NOT NULL DEFAULT '',
  45. `expires` int(11) NOT NULL DEFAULT 0,
  46. `scope` varchar(250) NOT NULL DEFAULT '',
  47. PRIMARY KEY(`id`)
  48. ) DEFAULT COLLATE utf8mb4_general_ci;
  49. --
  50. -- TABLE cache
  51. --
  52. CREATE TABLE IF NOT EXISTS `cache` (
  53. `k` varbinary(255) NOT NULL,
  54. `v` mediumtext,
  55. `expire_mode` int(11) NOT NULL DEFAULT 0,
  56. `updated` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  57. PRIMARY KEY(`k`),
  58. INDEX `expire_mode_updated` (`expire_mode`,`updated`)
  59. ) DEFAULT COLLATE utf8mb4_general_ci;
  60. --
  61. -- TABLE challenge
  62. --
  63. CREATE TABLE IF NOT EXISTS `challenge` (
  64. `id` int(10) unsigned NOT NULL auto_increment,
  65. `challenge` varchar(255) NOT NULL DEFAULT '',
  66. `dfrn-id` varchar(255) NOT NULL DEFAULT '',
  67. `expire` int(11) NOT NULL DEFAULT 0,
  68. `type` varchar(255) NOT NULL DEFAULT '',
  69. `last_update` varchar(255) NOT NULL DEFAULT '',
  70. PRIMARY KEY(`id`)
  71. ) DEFAULT COLLATE utf8mb4_general_ci;
  72. --
  73. -- TABLE clients
  74. --
  75. CREATE TABLE IF NOT EXISTS `clients` (
  76. `client_id` varchar(20) NOT NULL,
  77. `pw` varchar(20) NOT NULL DEFAULT '',
  78. `redirect_uri` varchar(200) NOT NULL DEFAULT '',
  79. `name` text,
  80. `icon` text,
  81. `uid` int(11) NOT NULL DEFAULT 0,
  82. PRIMARY KEY(`client_id`)
  83. ) DEFAULT COLLATE utf8mb4_general_ci;
  84. --
  85. -- TABLE config
  86. --
  87. CREATE TABLE IF NOT EXISTS `config` (
  88. `id` int(10) unsigned NOT NULL auto_increment,
  89. `cat` varbinary(255) NOT NULL DEFAULT '',
  90. `k` varbinary(255) NOT NULL DEFAULT '',
  91. `v` mediumtext,
  92. PRIMARY KEY(`id`),
  93. UNIQUE INDEX `cat_k` (`cat`,`k`)
  94. ) DEFAULT COLLATE utf8mb4_general_ci;
  95. --
  96. -- TABLE contact
  97. --
  98. CREATE TABLE IF NOT EXISTS `contact` (
  99. `id` int(11) NOT NULL auto_increment,
  100. `uid` int(11) NOT NULL DEFAULT 0,
  101. `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  102. `self` tinyint(1) NOT NULL DEFAULT 0,
  103. `remote_self` tinyint(1) NOT NULL DEFAULT 0,
  104. `rel` tinyint(1) NOT NULL DEFAULT 0,
  105. `duplex` tinyint(1) NOT NULL DEFAULT 0,
  106. `network` varchar(255) NOT NULL DEFAULT '',
  107. `name` varchar(255) NOT NULL DEFAULT '',
  108. `nick` varchar(255) NOT NULL DEFAULT '',
  109. `location` varchar(255) NOT NULL DEFAULT '',
  110. `about` text,
  111. `keywords` text,
  112. `gender` varchar(32) NOT NULL DEFAULT '',
  113. `xmpp` varchar(255) NOT NULL DEFAULT '',
  114. `attag` varchar(255) NOT NULL DEFAULT '',
  115. `avatar` varchar(255) NOT NULL DEFAULT '',
  116. `photo` text,
  117. `thumb` text,
  118. `micro` text,
  119. `site-pubkey` text,
  120. `issued-id` varchar(255) NOT NULL DEFAULT '',
  121. `dfrn-id` varchar(255) NOT NULL DEFAULT '',
  122. `url` varchar(255) NOT NULL DEFAULT '',
  123. `nurl` varchar(255) NOT NULL DEFAULT '',
  124. `addr` varchar(255) NOT NULL DEFAULT '',
  125. `alias` varchar(255) NOT NULL DEFAULT '',
  126. `pubkey` text,
  127. `prvkey` text,
  128. `batch` varchar(255) NOT NULL DEFAULT '',
  129. `request` text,
  130. `notify` text,
  131. `poll` text,
  132. `confirm` text,
  133. `poco` text,
  134. `aes_allow` tinyint(1) NOT NULL DEFAULT 0,
  135. `ret-aes` tinyint(1) NOT NULL DEFAULT 0,
  136. `usehub` tinyint(1) NOT NULL DEFAULT 0,
  137. `subhub` tinyint(1) NOT NULL DEFAULT 0,
  138. `hub-verify` varchar(255) NOT NULL DEFAULT '',
  139. `last-update` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  140. `success_update` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  141. `failure_update` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  142. `name-date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  143. `uri-date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  144. `avatar-date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  145. `term-date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  146. `last-item` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  147. `priority` tinyint(3) NOT NULL DEFAULT 0,
  148. `blocked` tinyint(1) NOT NULL DEFAULT 1,
  149. `readonly` tinyint(1) NOT NULL DEFAULT 0,
  150. `writable` tinyint(1) NOT NULL DEFAULT 0,
  151. `forum` tinyint(1) NOT NULL DEFAULT 0,
  152. `prv` tinyint(1) NOT NULL DEFAULT 0,
  153. `contact-type` int(11) NOT NULL DEFAULT 0,
  154. `hidden` tinyint(1) NOT NULL DEFAULT 0,
  155. `archive` tinyint(1) NOT NULL DEFAULT 0,
  156. `pending` tinyint(1) NOT NULL DEFAULT 1,
  157. `rating` tinyint(1) NOT NULL DEFAULT 0,
  158. `reason` text,
  159. `closeness` tinyint(2) NOT NULL DEFAULT 99,
  160. `info` mediumtext,
  161. `profile-id` int(11) NOT NULL DEFAULT 0,
  162. `bdyear` varchar(4) NOT NULL DEFAULT '',
  163. `bd` date NOT NULL DEFAULT '0001-01-01',
  164. `notify_new_posts` tinyint(1) NOT NULL DEFAULT 0,
  165. `fetch_further_information` tinyint(1) NOT NULL DEFAULT 0,
  166. `ffi_keyword_blacklist` text,
  167. PRIMARY KEY(`id`),
  168. INDEX `uid_name` (`uid`,`name`(190)),
  169. INDEX `self_uid` (`self`,`uid`),
  170. INDEX `alias_uid` (`alias`(32),`uid`),
  171. INDEX `pending_uid` (`pending`,`uid`),
  172. INDEX `blocked_uid` (`blocked`,`uid`),
  173. INDEX `uid_rel_network_poll` (`uid`,`rel`,`network`(4),`poll`(64),`archive`),
  174. INDEX `uid_network_batch` (`uid`,`network`(4),`batch`(64)),
  175. INDEX `addr_uid` (`addr`(32),`uid`),
  176. INDEX `nurl_uid` (`nurl`(32),`uid`),
  177. INDEX `nick_uid` (`nick`(32),`uid`),
  178. INDEX `dfrn-id` (`dfrn-id`),
  179. INDEX `issued-id` (`issued-id`)
  180. ) DEFAULT COLLATE utf8mb4_general_ci;
  181. --
  182. -- TABLE conv
  183. --
  184. CREATE TABLE IF NOT EXISTS `conv` (
  185. `id` int(10) unsigned NOT NULL auto_increment,
  186. `guid` varchar(64) NOT NULL DEFAULT '',
  187. `recips` text,
  188. `uid` int(11) NOT NULL DEFAULT 0,
  189. `creator` varchar(255) NOT NULL DEFAULT '',
  190. `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  191. `updated` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  192. `subject` text,
  193. PRIMARY KEY(`id`),
  194. INDEX `uid` (`uid`)
  195. ) DEFAULT COLLATE utf8mb4_general_ci;
  196. --
  197. -- TABLE conversation
  198. --
  199. CREATE TABLE IF NOT EXISTS `conversation` (
  200. `item-uri` varbinary(255) NOT NULL,
  201. `reply-to-uri` varbinary(255) NOT NULL DEFAULT '',
  202. `conversation-uri` varbinary(255) NOT NULL DEFAULT '',
  203. `conversation-href` varbinary(255) NOT NULL DEFAULT '',
  204. `protocol` tinyint(1) unsigned NOT NULL DEFAULT 0,
  205. `source` mediumtext,
  206. `received` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  207. PRIMARY KEY(`item-uri`),
  208. INDEX `conversation-uri` (`conversation-uri`)
  209. ) DEFAULT COLLATE utf8mb4_general_ci;
  210. --
  211. -- TABLE event
  212. --
  213. CREATE TABLE IF NOT EXISTS `event` (
  214. `id` int(11) NOT NULL auto_increment,
  215. `guid` varchar(255) NOT NULL DEFAULT '',
  216. `uid` int(11) NOT NULL DEFAULT 0,
  217. `cid` int(11) NOT NULL DEFAULT 0,
  218. `uri` varchar(255) NOT NULL DEFAULT '',
  219. `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  220. `edited` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  221. `start` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  222. `finish` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  223. `summary` text,
  224. `desc` text,
  225. `location` text,
  226. `type` varchar(255) NOT NULL DEFAULT '',
  227. `nofinish` tinyint(1) NOT NULL DEFAULT 0,
  228. `adjust` tinyint(1) NOT NULL DEFAULT 1,
  229. `ignore` tinyint(1) unsigned NOT NULL DEFAULT 0,
  230. `allow_cid` mediumtext,
  231. `allow_gid` mediumtext,
  232. `deny_cid` mediumtext,
  233. `deny_gid` mediumtext,
  234. PRIMARY KEY(`id`),
  235. INDEX `uid_start` (`uid`,`start`)
  236. ) DEFAULT COLLATE utf8mb4_general_ci;
  237. --
  238. -- TABLE fcontact
  239. --
  240. CREATE TABLE IF NOT EXISTS `fcontact` (
  241. `id` int(10) unsigned NOT NULL auto_increment,
  242. `guid` varchar(255) NOT NULL DEFAULT '',
  243. `url` varchar(255) NOT NULL DEFAULT '',
  244. `name` varchar(255) NOT NULL DEFAULT '',
  245. `photo` varchar(255) NOT NULL DEFAULT '',
  246. `request` varchar(255) NOT NULL DEFAULT '',
  247. `nick` varchar(255) NOT NULL DEFAULT '',
  248. `addr` varchar(255) NOT NULL DEFAULT '',
  249. `batch` varchar(255) NOT NULL DEFAULT '',
  250. `notify` varchar(255) NOT NULL DEFAULT '',
  251. `poll` varchar(255) NOT NULL DEFAULT '',
  252. `confirm` varchar(255) NOT NULL DEFAULT '',
  253. `priority` tinyint(1) NOT NULL DEFAULT 0,
  254. `network` varchar(32) NOT NULL DEFAULT '',
  255. `alias` varchar(255) NOT NULL DEFAULT '',
  256. `pubkey` text,
  257. `updated` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  258. PRIMARY KEY(`id`),
  259. INDEX `addr` (`addr`(32)),
  260. INDEX `url` (`url`)
  261. ) DEFAULT COLLATE utf8mb4_general_ci;
  262. --
  263. -- TABLE ffinder
  264. --
  265. CREATE TABLE IF NOT EXISTS `ffinder` (
  266. `id` int(10) unsigned NOT NULL auto_increment,
  267. `uid` int(10) unsigned NOT NULL DEFAULT 0,
  268. `cid` int(10) unsigned NOT NULL DEFAULT 0,
  269. `fid` int(10) unsigned NOT NULL DEFAULT 0,
  270. PRIMARY KEY(`id`)
  271. ) DEFAULT COLLATE utf8mb4_general_ci;
  272. --
  273. -- TABLE fserver
  274. --
  275. CREATE TABLE IF NOT EXISTS `fserver` (
  276. `id` int(11) NOT NULL auto_increment,
  277. `server` varchar(255) NOT NULL DEFAULT '',
  278. `posturl` varchar(255) NOT NULL DEFAULT '',
  279. `key` text,
  280. PRIMARY KEY(`id`),
  281. INDEX `server` (`server`(32))
  282. ) DEFAULT COLLATE utf8mb4_general_ci;
  283. --
  284. -- TABLE fsuggest
  285. --
  286. CREATE TABLE IF NOT EXISTS `fsuggest` (
  287. `id` int(11) NOT NULL auto_increment,
  288. `uid` int(11) NOT NULL DEFAULT 0,
  289. `cid` int(11) NOT NULL DEFAULT 0,
  290. `name` varchar(255) NOT NULL DEFAULT '',
  291. `url` varchar(255) NOT NULL DEFAULT '',
  292. `request` varchar(255) NOT NULL DEFAULT '',
  293. `photo` varchar(255) NOT NULL DEFAULT '',
  294. `note` text,
  295. `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  296. PRIMARY KEY(`id`)
  297. ) DEFAULT COLLATE utf8mb4_general_ci;
  298. --
  299. -- TABLE gcign
  300. --
  301. CREATE TABLE IF NOT EXISTS `gcign` (
  302. `id` int(11) NOT NULL auto_increment,
  303. `uid` int(11) NOT NULL DEFAULT 0,
  304. `gcid` int(11) NOT NULL DEFAULT 0,
  305. PRIMARY KEY(`id`),
  306. INDEX `uid` (`uid`),
  307. INDEX `gcid` (`gcid`)
  308. ) DEFAULT COLLATE utf8mb4_general_ci;
  309. --
  310. -- TABLE gcontact
  311. --
  312. CREATE TABLE IF NOT EXISTS `gcontact` (
  313. `id` int(10) unsigned NOT NULL auto_increment,
  314. `name` varchar(255) NOT NULL DEFAULT '',
  315. `nick` varchar(255) NOT NULL DEFAULT '',
  316. `url` varchar(255) NOT NULL DEFAULT '',
  317. `nurl` varchar(255) NOT NULL DEFAULT '',
  318. `photo` varchar(255) NOT NULL DEFAULT '',
  319. `connect` varchar(255) NOT NULL DEFAULT '',
  320. `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  321. `updated` datetime DEFAULT '0001-01-01 00:00:00',
  322. `last_contact` datetime DEFAULT '0001-01-01 00:00:00',
  323. `last_failure` datetime DEFAULT '0001-01-01 00:00:00',
  324. `location` varchar(255) NOT NULL DEFAULT '',
  325. `about` text,
  326. `keywords` text,
  327. `gender` varchar(32) NOT NULL DEFAULT '',
  328. `birthday` varchar(32) NOT NULL DEFAULT '0001-01-01',
  329. `community` tinyint(1) NOT NULL DEFAULT 0,
  330. `contact-type` tinyint(1) NOT NULL DEFAULT -1,
  331. `hide` tinyint(1) NOT NULL DEFAULT 0,
  332. `nsfw` tinyint(1) NOT NULL DEFAULT 0,
  333. `network` varchar(255) NOT NULL DEFAULT '',
  334. `addr` varchar(255) NOT NULL DEFAULT '',
  335. `notify` text,
  336. `alias` varchar(255) NOT NULL DEFAULT '',
  337. `generation` tinyint(3) NOT NULL DEFAULT 0,
  338. `server_url` varchar(255) NOT NULL DEFAULT '',
  339. PRIMARY KEY(`id`),
  340. INDEX `nurl` (`nurl`(64)),
  341. INDEX `name` (`name`(64)),
  342. INDEX `nick` (`nick`(32)),
  343. INDEX `addr` (`addr`(64)),
  344. INDEX `hide_network_updated` (`hide`,`network`(4),`updated`),
  345. INDEX `updated` (`updated`)
  346. ) DEFAULT COLLATE utf8mb4_general_ci;
  347. --
  348. -- TABLE glink
  349. --
  350. CREATE TABLE IF NOT EXISTS `glink` (
  351. `id` int(10) unsigned NOT NULL auto_increment,
  352. `cid` int(11) NOT NULL DEFAULT 0,
  353. `uid` int(11) NOT NULL DEFAULT 0,
  354. `gcid` int(11) NOT NULL DEFAULT 0,
  355. `zcid` int(11) NOT NULL DEFAULT 0,
  356. `updated` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  357. PRIMARY KEY(`id`),
  358. UNIQUE INDEX `cid_uid_gcid_zcid` (`cid`,`uid`,`gcid`,`zcid`),
  359. INDEX `gcid` (`gcid`)
  360. ) DEFAULT COLLATE utf8mb4_general_ci;
  361. --
  362. -- TABLE group
  363. --
  364. CREATE TABLE IF NOT EXISTS `group` (
  365. `id` int(10) unsigned NOT NULL auto_increment,
  366. `uid` int(10) unsigned NOT NULL DEFAULT 0,
  367. `visible` tinyint(1) NOT NULL DEFAULT 0,
  368. `deleted` tinyint(1) NOT NULL DEFAULT 0,
  369. `name` varchar(255) NOT NULL DEFAULT '',
  370. PRIMARY KEY(`id`),
  371. INDEX `uid` (`uid`)
  372. ) DEFAULT COLLATE utf8mb4_general_ci;
  373. --
  374. -- TABLE group_member
  375. --
  376. CREATE TABLE IF NOT EXISTS `group_member` (
  377. `id` int(10) unsigned NOT NULL auto_increment,
  378. `uid` int(10) unsigned NOT NULL DEFAULT 0,
  379. `gid` int(10) unsigned NOT NULL DEFAULT 0,
  380. `contact-id` int(10) unsigned NOT NULL DEFAULT 0,
  381. PRIMARY KEY(`id`),
  382. INDEX `contactid` (`contact-id`),
  383. INDEX `gid_contactid` (`gid`,`contact-id`),
  384. UNIQUE INDEX `uid_gid_contactid` (`uid`,`gid`,`contact-id`)
  385. ) DEFAULT COLLATE utf8mb4_general_ci;
  386. --
  387. -- TABLE gserver
  388. --
  389. CREATE TABLE IF NOT EXISTS `gserver` (
  390. `id` int(10) unsigned NOT NULL auto_increment,
  391. `url` varchar(255) NOT NULL DEFAULT '',
  392. `nurl` varchar(255) NOT NULL DEFAULT '',
  393. `version` varchar(255) NOT NULL DEFAULT '',
  394. `site_name` varchar(255) NOT NULL DEFAULT '',
  395. `info` text,
  396. `register_policy` tinyint(1) NOT NULL DEFAULT 0,
  397. `poco` varchar(255) NOT NULL DEFAULT '',
  398. `noscrape` varchar(255) NOT NULL DEFAULT '',
  399. `network` varchar(32) NOT NULL DEFAULT '',
  400. `platform` varchar(255) NOT NULL DEFAULT '',
  401. `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  402. `last_poco_query` datetime DEFAULT '0001-01-01 00:00:00',
  403. `last_contact` datetime DEFAULT '0001-01-01 00:00:00',
  404. `last_failure` datetime DEFAULT '0001-01-01 00:00:00',
  405. PRIMARY KEY(`id`),
  406. INDEX `nurl` (`nurl`(32))
  407. ) DEFAULT COLLATE utf8mb4_general_ci;
  408. --
  409. -- TABLE hook
  410. --
  411. CREATE TABLE IF NOT EXISTS `hook` (
  412. `id` int(11) NOT NULL auto_increment,
  413. `hook` varchar(255) NOT NULL DEFAULT '',
  414. `file` varchar(255) NOT NULL DEFAULT '',
  415. `function` varchar(255) NOT NULL DEFAULT '',
  416. `priority` int(11) unsigned NOT NULL DEFAULT 0,
  417. PRIMARY KEY(`id`),
  418. UNIQUE INDEX `hook_file_function` (`hook`(50),`file`(80),`function`(60))
  419. ) DEFAULT COLLATE utf8mb4_general_ci;
  420. --
  421. -- TABLE intro
  422. --
  423. CREATE TABLE IF NOT EXISTS `intro` (
  424. `id` int(10) unsigned NOT NULL auto_increment,
  425. `uid` int(10) unsigned NOT NULL DEFAULT 0,
  426. `fid` int(11) NOT NULL DEFAULT 0,
  427. `contact-id` int(11) NOT NULL DEFAULT 0,
  428. `knowyou` tinyint(1) NOT NULL DEFAULT 0,
  429. `duplex` tinyint(1) NOT NULL DEFAULT 0,
  430. `note` text,
  431. `hash` varchar(255) NOT NULL DEFAULT '',
  432. `datetime` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  433. `blocked` tinyint(1) NOT NULL DEFAULT 1,
  434. `ignore` tinyint(1) NOT NULL DEFAULT 0,
  435. PRIMARY KEY(`id`)
  436. ) DEFAULT COLLATE utf8mb4_general_ci;
  437. --
  438. -- TABLE item
  439. --
  440. CREATE TABLE IF NOT EXISTS `item` (
  441. `id` int(10) unsigned NOT NULL auto_increment,
  442. `guid` varchar(255) NOT NULL DEFAULT '',
  443. `uri` varchar(255) NOT NULL DEFAULT '',
  444. `uid` int(10) unsigned NOT NULL DEFAULT 0,
  445. `contact-id` int(11) NOT NULL DEFAULT 0,
  446. `gcontact-id` int(11) unsigned NOT NULL DEFAULT 0,
  447. `type` varchar(255) NOT NULL DEFAULT '',
  448. `wall` tinyint(1) NOT NULL DEFAULT 0,
  449. `gravity` tinyint(1) NOT NULL DEFAULT 0,
  450. `parent` int(10) unsigned NOT NULL DEFAULT 0,
  451. `parent-uri` varchar(255) NOT NULL DEFAULT '',
  452. `extid` varchar(255) NOT NULL DEFAULT '',
  453. `thr-parent` varchar(255) NOT NULL DEFAULT '',
  454. `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  455. `edited` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  456. `commented` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  457. `received` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  458. `changed` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  459. `owner-id` int(11) NOT NULL DEFAULT 0,
  460. `owner-name` varchar(255) NOT NULL DEFAULT '',
  461. `owner-link` varchar(255) NOT NULL DEFAULT '',
  462. `owner-avatar` varchar(255) NOT NULL DEFAULT '',
  463. `author-id` int(11) NOT NULL DEFAULT 0,
  464. `author-name` varchar(255) NOT NULL DEFAULT '',
  465. `author-link` varchar(255) NOT NULL DEFAULT '',
  466. `author-avatar` varchar(255) NOT NULL DEFAULT '',
  467. `title` varchar(255) NOT NULL DEFAULT '',
  468. `body` mediumtext,
  469. `app` varchar(255) NOT NULL DEFAULT '',
  470. `verb` varchar(255) NOT NULL DEFAULT '',
  471. `object-type` varchar(255) NOT NULL DEFAULT '',
  472. `object` text,
  473. `target-type` varchar(255) NOT NULL DEFAULT '',
  474. `target` text,
  475. `postopts` text,
  476. `plink` varchar(255) NOT NULL DEFAULT '',
  477. `resource-id` varchar(255) NOT NULL DEFAULT '',
  478. `event-id` int(11) NOT NULL DEFAULT 0,
  479. `tag` mediumtext,
  480. `attach` mediumtext,
  481. `inform` mediumtext,
  482. `file` mediumtext,
  483. `location` varchar(255) NOT NULL DEFAULT '',
  484. `coord` varchar(255) NOT NULL DEFAULT '',
  485. `allow_cid` mediumtext,
  486. `allow_gid` mediumtext,
  487. `deny_cid` mediumtext,
  488. `deny_gid` mediumtext,
  489. `private` tinyint(1) NOT NULL DEFAULT 0,
  490. `pubmail` tinyint(1) NOT NULL DEFAULT 0,
  491. `moderated` tinyint(1) NOT NULL DEFAULT 0,
  492. `visible` tinyint(1) NOT NULL DEFAULT 0,
  493. `spam` tinyint(1) NOT NULL DEFAULT 0,
  494. `starred` tinyint(1) NOT NULL DEFAULT 0,
  495. `bookmark` tinyint(1) NOT NULL DEFAULT 0,
  496. `unseen` tinyint(1) NOT NULL DEFAULT 1,
  497. `deleted` tinyint(1) NOT NULL DEFAULT 0,
  498. `origin` tinyint(1) NOT NULL DEFAULT 0,
  499. `forum_mode` tinyint(1) NOT NULL DEFAULT 0,
  500. `last-child` tinyint(1) unsigned NOT NULL DEFAULT 1,
  501. `mention` tinyint(1) NOT NULL DEFAULT 0,
  502. `network` varchar(32) NOT NULL DEFAULT '',
  503. `rendered-hash` varchar(32) NOT NULL DEFAULT '',
  504. `rendered-html` mediumtext,
  505. `global` tinyint(1) NOT NULL DEFAULT 0,
  506. PRIMARY KEY(`id`),
  507. INDEX `guid` (`guid`),
  508. INDEX `uri` (`uri`),
  509. INDEX `parent` (`parent`),
  510. INDEX `parent-uri` (`parent-uri`),
  511. INDEX `extid` (`extid`),
  512. INDEX `uid_id` (`uid`,`id`),
  513. INDEX `uid_contactid_id` (`uid`,`contact-id`,`id`),
  514. INDEX `uid_created` (`uid`,`created`),
  515. INDEX `uid_unseen_contactid` (`uid`,`unseen`,`contact-id`),
  516. INDEX `uid_network_received` (`uid`,`network`(4),`received`),
  517. INDEX `uid_network_commented` (`uid`,`network`(4),`commented`),
  518. INDEX `uid_thrparent` (`uid`,`thr-parent`(190)),
  519. INDEX `uid_parenturi` (`uid`,`parent-uri`(190)),
  520. INDEX `uid_contactid_created` (`uid`,`contact-id`,`created`),
  521. INDEX `authorid_created` (`author-id`,`created`),
  522. INDEX `uid_uri` (`uid`,`uri`(190)),
  523. INDEX `resource-id` (`resource-id`),
  524. INDEX `contactid_allowcid_allowpid_denycid_denygid` (`contact-id`,`allow_cid`(10),`allow_gid`(10),`deny_cid`(10),`deny_gid`(10)),
  525. INDEX `uid_type_changed` (`uid`,`type`(190),`changed`),
  526. INDEX `contactid_verb` (`contact-id`,`verb`(190)),
  527. INDEX `deleted_changed` (`deleted`,`changed`),
  528. INDEX `uid_wall_changed` (`uid`,`wall`,`changed`),
  529. INDEX `uid_eventid` (`uid`,`event-id`),
  530. INDEX `uid_authorlink` (`uid`,`author-link`(190)),
  531. INDEX `uid_ownerlink` (`uid`,`owner-link`(190))
  532. ) DEFAULT COLLATE utf8mb4_general_ci;
  533. --
  534. -- TABLE item_id
  535. --
  536. CREATE TABLE IF NOT EXISTS `item_id` (
  537. `id` int(11) NOT NULL auto_increment,
  538. `iid` int(11) NOT NULL DEFAULT 0,
  539. `uid` int(11) NOT NULL DEFAULT 0,
  540. `sid` varchar(255) NOT NULL DEFAULT '',
  541. `service` varchar(255) NOT NULL DEFAULT '',
  542. PRIMARY KEY(`id`),
  543. INDEX `uid` (`uid`),
  544. INDEX `sid` (`sid`),
  545. INDEX `service` (`service`(32)),
  546. INDEX `iid` (`iid`)
  547. ) DEFAULT COLLATE utf8mb4_general_ci;
  548. --
  549. -- TABLE locks
  550. --
  551. CREATE TABLE IF NOT EXISTS `locks` (
  552. `id` int(11) NOT NULL auto_increment,
  553. `name` varchar(128) NOT NULL DEFAULT '',
  554. `locked` tinyint(1) NOT NULL DEFAULT 0,
  555. `created` datetime DEFAULT '0001-01-01 00:00:00',
  556. PRIMARY KEY(`id`)
  557. ) DEFAULT COLLATE utf8mb4_general_ci;
  558. --
  559. -- TABLE mail
  560. --
  561. CREATE TABLE IF NOT EXISTS `mail` (
  562. `id` int(10) unsigned NOT NULL auto_increment,
  563. `uid` int(10) unsigned NOT NULL DEFAULT 0,
  564. `guid` varchar(64) NOT NULL DEFAULT '',
  565. `from-name` varchar(255) NOT NULL DEFAULT '',
  566. `from-photo` varchar(255) NOT NULL DEFAULT '',
  567. `from-url` varchar(255) NOT NULL DEFAULT '',
  568. `contact-id` varchar(255) NOT NULL DEFAULT '',
  569. `convid` int(11) unsigned NOT NULL DEFAULT 0,
  570. `title` varchar(255) NOT NULL DEFAULT '',
  571. `body` mediumtext,
  572. `seen` tinyint(1) NOT NULL DEFAULT 0,
  573. `reply` tinyint(1) NOT NULL DEFAULT 0,
  574. `replied` tinyint(1) NOT NULL DEFAULT 0,
  575. `unknown` tinyint(1) NOT NULL DEFAULT 0,
  576. `uri` varchar(255) NOT NULL DEFAULT '',
  577. `parent-uri` varchar(255) NOT NULL DEFAULT '',
  578. `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  579. PRIMARY KEY(`id`),
  580. INDEX `uid_seen` (`uid`,`seen`),
  581. INDEX `convid` (`convid`),
  582. INDEX `uri` (`uri`(64)),
  583. INDEX `parent-uri` (`parent-uri`(64))
  584. ) DEFAULT COLLATE utf8mb4_general_ci;
  585. --
  586. -- TABLE mailacct
  587. --
  588. CREATE TABLE IF NOT EXISTS `mailacct` (
  589. `id` int(11) NOT NULL auto_increment,
  590. `uid` int(11) NOT NULL DEFAULT 0,
  591. `server` varchar(255) NOT NULL DEFAULT '',
  592. `port` int(11) NOT NULL DEFAULT 0,
  593. `ssltype` varchar(16) NOT NULL DEFAULT '',
  594. `mailbox` varchar(255) NOT NULL DEFAULT '',
  595. `user` varchar(255) NOT NULL DEFAULT '',
  596. `pass` text,
  597. `reply_to` varchar(255) NOT NULL DEFAULT '',
  598. `action` int(11) NOT NULL DEFAULT 0,
  599. `movetofolder` varchar(255) NOT NULL DEFAULT '',
  600. `pubmail` tinyint(1) NOT NULL DEFAULT 0,
  601. `last_check` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  602. PRIMARY KEY(`id`)
  603. ) DEFAULT COLLATE utf8mb4_general_ci;
  604. --
  605. -- TABLE manage
  606. --
  607. CREATE TABLE IF NOT EXISTS `manage` (
  608. `id` int(11) NOT NULL auto_increment,
  609. `uid` int(11) NOT NULL DEFAULT 0,
  610. `mid` int(11) NOT NULL DEFAULT 0,
  611. PRIMARY KEY(`id`),
  612. UNIQUE INDEX `uid_mid` (`uid`,`mid`)
  613. ) DEFAULT COLLATE utf8mb4_general_ci;
  614. --
  615. -- TABLE notify
  616. --
  617. CREATE TABLE IF NOT EXISTS `notify` (
  618. `id` int(11) NOT NULL auto_increment,
  619. `hash` varchar(64) NOT NULL DEFAULT '',
  620. `type` int(11) NOT NULL DEFAULT 0,
  621. `name` varchar(255) NOT NULL DEFAULT '',
  622. `url` varchar(255) NOT NULL DEFAULT '',
  623. `photo` varchar(255) NOT NULL DEFAULT '',
  624. `date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  625. `msg` mediumtext,
  626. `uid` int(11) NOT NULL DEFAULT 0,
  627. `link` varchar(255) NOT NULL DEFAULT '',
  628. `iid` int(11) NOT NULL DEFAULT 0,
  629. `parent` int(11) NOT NULL DEFAULT 0,
  630. `seen` tinyint(1) NOT NULL DEFAULT 0,
  631. `verb` varchar(255) NOT NULL DEFAULT '',
  632. `otype` varchar(16) NOT NULL DEFAULT '',
  633. `name_cache` tinytext,
  634. `msg_cache` mediumtext,
  635. PRIMARY KEY(`id`),
  636. INDEX `hash_uid` (`hash`,`uid`),
  637. INDEX `seen_uid_date` (`seen`,`uid`,`date`),
  638. INDEX `uid_date` (`uid`,`date`),
  639. INDEX `uid_type_link` (`uid`,`type`,`link`(190))
  640. ) DEFAULT COLLATE utf8mb4_general_ci;
  641. --
  642. -- TABLE notify-threads
  643. --
  644. CREATE TABLE IF NOT EXISTS `notify-threads` (
  645. `id` int(11) NOT NULL auto_increment,
  646. `notify-id` int(11) NOT NULL DEFAULT 0,
  647. `master-parent-item` int(10) unsigned NOT NULL DEFAULT 0,
  648. `parent-item` int(10) unsigned NOT NULL DEFAULT 0,
  649. `receiver-uid` int(11) NOT NULL DEFAULT 0,
  650. PRIMARY KEY(`id`)
  651. ) DEFAULT COLLATE utf8mb4_general_ci;
  652. --
  653. -- TABLE oembed
  654. --
  655. CREATE TABLE IF NOT EXISTS `oembed` (
  656. `url` varbinary(255) NOT NULL,
  657. `content` mediumtext,
  658. `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  659. PRIMARY KEY(`url`),
  660. INDEX `created` (`created`)
  661. ) DEFAULT COLLATE utf8mb4_general_ci;
  662. --
  663. -- TABLE parsed_url
  664. --
  665. CREATE TABLE IF NOT EXISTS `parsed_url` (
  666. `url` varbinary(255) NOT NULL,
  667. `guessing` tinyint(1) NOT NULL DEFAULT 0,
  668. `oembed` tinyint(1) NOT NULL DEFAULT 0,
  669. `content` mediumtext,
  670. `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  671. PRIMARY KEY(`url`,`guessing`,`oembed`),
  672. INDEX `created` (`created`)
  673. ) DEFAULT COLLATE utf8mb4_general_ci;
  674. --
  675. -- TABLE pconfig
  676. --
  677. CREATE TABLE IF NOT EXISTS `pconfig` (
  678. `id` int(11) NOT NULL auto_increment,
  679. `uid` int(11) NOT NULL DEFAULT 0,
  680. `cat` varbinary(255) NOT NULL DEFAULT '',
  681. `k` varbinary(255) NOT NULL DEFAULT '',
  682. `v` mediumtext,
  683. PRIMARY KEY(`id`),
  684. UNIQUE INDEX `uid_cat_k` (`uid`,`cat`,`k`)
  685. ) DEFAULT COLLATE utf8mb4_general_ci;
  686. --
  687. -- TABLE photo
  688. --
  689. CREATE TABLE IF NOT EXISTS `photo` (
  690. `id` int(10) unsigned NOT NULL auto_increment,
  691. `uid` int(10) unsigned NOT NULL DEFAULT 0,
  692. `contact-id` int(10) unsigned NOT NULL DEFAULT 0,
  693. `guid` varchar(64) NOT NULL DEFAULT '',
  694. `resource-id` varchar(255) NOT NULL DEFAULT '',
  695. `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  696. `edited` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  697. `title` varchar(255) NOT NULL DEFAULT '',
  698. `desc` text,
  699. `album` varchar(255) NOT NULL DEFAULT '',
  700. `filename` varchar(255) NOT NULL DEFAULT '',
  701. `type` varchar(128) NOT NULL DEFAULT 'image/jpeg',
  702. `height` smallint(6) NOT NULL DEFAULT 0,
  703. `width` smallint(6) NOT NULL DEFAULT 0,
  704. `datasize` int(10) unsigned NOT NULL DEFAULT 0,
  705. `data` mediumblob NOT NULL,
  706. `scale` tinyint(3) NOT NULL DEFAULT 0,
  707. `profile` tinyint(1) NOT NULL DEFAULT 0,
  708. `allow_cid` mediumtext,
  709. `allow_gid` mediumtext,
  710. `deny_cid` mediumtext,
  711. `deny_gid` mediumtext,
  712. PRIMARY KEY(`id`),
  713. INDEX `uid_contactid` (`uid`,`contact-id`),
  714. INDEX `uid_profile` (`uid`,`profile`),
  715. INDEX `uid_album_scale_created` (`uid`,`album`(32),`scale`,`created`),
  716. INDEX `uid_album_resource-id_created` (`uid`,`album`(32),`resource-id`(64),`created`),
  717. INDEX `resource-id` (`resource-id`(64))
  718. ) DEFAULT COLLATE utf8mb4_general_ci;
  719. --
  720. -- TABLE poll
  721. --
  722. CREATE TABLE IF NOT EXISTS `poll` (
  723. `id` int(11) NOT NULL auto_increment,
  724. `uid` int(11) NOT NULL DEFAULT 0,
  725. `q0` text,
  726. `q1` text,
  727. `q2` text,
  728. `q3` text,
  729. `q4` text,
  730. `q5` text,
  731. `q6` text,
  732. `q7` text,
  733. `q8` text,
  734. `q9` text,
  735. PRIMARY KEY(`id`),
  736. INDEX `uid` (`uid`)
  737. ) DEFAULT COLLATE utf8mb4_general_ci;
  738. --
  739. -- TABLE poll_result
  740. --
  741. CREATE TABLE IF NOT EXISTS `poll_result` (
  742. `id` int(11) NOT NULL auto_increment,
  743. `poll_id` int(11) NOT NULL DEFAULT 0,
  744. `choice` int(11) NOT NULL DEFAULT 0,
  745. PRIMARY KEY(`id`),
  746. INDEX `poll_id` (`poll_id`),
  747. INDEX `choice` (`choice`)
  748. ) DEFAULT COLLATE utf8mb4_general_ci;
  749. --
  750. -- TABLE process
  751. --
  752. CREATE TABLE IF NOT EXISTS `process` (
  753. `pid` int(10) unsigned NOT NULL,
  754. `command` varbinary(32) NOT NULL DEFAULT '',
  755. `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  756. PRIMARY KEY(`pid`),
  757. INDEX `command` (`command`)
  758. ) DEFAULT COLLATE utf8mb4_general_ci;
  759. --
  760. -- TABLE profile
  761. --
  762. CREATE TABLE IF NOT EXISTS `profile` (
  763. `id` int(11) NOT NULL auto_increment,
  764. `uid` int(11) NOT NULL DEFAULT 0,
  765. `profile-name` varchar(255) NOT NULL DEFAULT '',
  766. `is-default` tinyint(1) NOT NULL DEFAULT 0,
  767. `hide-friends` tinyint(1) NOT NULL DEFAULT 0,
  768. `name` varchar(255) NOT NULL DEFAULT '',
  769. `pdesc` varchar(255) NOT NULL DEFAULT '',
  770. `dob` varchar(32) NOT NULL DEFAULT '0001-01-01',
  771. `address` varchar(255) NOT NULL DEFAULT '',
  772. `locality` varchar(255) NOT NULL DEFAULT '',
  773. `region` varchar(255) NOT NULL DEFAULT '',
  774. `postal-code` varchar(32) NOT NULL DEFAULT '',
  775. `country-name` varchar(255) NOT NULL DEFAULT '',
  776. `hometown` varchar(255) NOT NULL DEFAULT '',
  777. `gender` varchar(32) NOT NULL DEFAULT '',
  778. `marital` varchar(255) NOT NULL DEFAULT '',
  779. `with` text,
  780. `howlong` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  781. `sexual` varchar(255) NOT NULL DEFAULT '',
  782. `politic` varchar(255) NOT NULL DEFAULT '',
  783. `religion` varchar(255) NOT NULL DEFAULT '',
  784. `pub_keywords` text,
  785. `prv_keywords` text,
  786. `likes` text,
  787. `dislikes` text,
  788. `about` text,
  789. `summary` varchar(255) NOT NULL DEFAULT '',
  790. `music` text,
  791. `book` text,
  792. `tv` text,
  793. `film` text,
  794. `interest` text,
  795. `romance` text,
  796. `work` text,
  797. `education` text,
  798. `contact` text,
  799. `homepage` varchar(255) NOT NULL DEFAULT '',
  800. `xmpp` varchar(255) NOT NULL DEFAULT '',
  801. `photo` varchar(255) NOT NULL DEFAULT '',
  802. `thumb` varchar(255) NOT NULL DEFAULT '',
  803. `publish` tinyint(1) NOT NULL DEFAULT 0,
  804. `net-publish` tinyint(1) NOT NULL DEFAULT 0,
  805. PRIMARY KEY(`id`),
  806. INDEX `uid_is-default` (`uid`,`is-default`)
  807. ) DEFAULT COLLATE utf8mb4_general_ci;
  808. --
  809. -- TABLE profile_check
  810. --
  811. CREATE TABLE IF NOT EXISTS `profile_check` (
  812. `id` int(10) unsigned NOT NULL auto_increment,
  813. `uid` int(10) unsigned NOT NULL DEFAULT 0,
  814. `cid` int(10) unsigned NOT NULL DEFAULT 0,
  815. `dfrn_id` varchar(255) NOT NULL DEFAULT '',
  816. `sec` varchar(255) NOT NULL DEFAULT '',
  817. `expire` int(11) NOT NULL DEFAULT 0,
  818. PRIMARY KEY(`id`)
  819. ) DEFAULT COLLATE utf8mb4_general_ci;
  820. --
  821. -- TABLE push_subscriber
  822. --
  823. CREATE TABLE IF NOT EXISTS `push_subscriber` (
  824. `id` int(11) NOT NULL auto_increment,
  825. `uid` int(11) NOT NULL DEFAULT 0,
  826. `callback_url` varchar(255) NOT NULL DEFAULT '',
  827. `topic` varchar(255) NOT NULL DEFAULT '',
  828. `nickname` varchar(255) NOT NULL DEFAULT '',
  829. `push` int(11) NOT NULL DEFAULT 0,
  830. `last_update` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  831. `secret` varchar(255) NOT NULL DEFAULT '',
  832. PRIMARY KEY(`id`)
  833. ) DEFAULT COLLATE utf8mb4_general_ci;
  834. --
  835. -- TABLE queue
  836. --
  837. CREATE TABLE IF NOT EXISTS `queue` (
  838. `id` int(11) NOT NULL auto_increment,
  839. `cid` int(11) NOT NULL DEFAULT 0,
  840. `network` varchar(32) NOT NULL DEFAULT '',
  841. `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  842. `last` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  843. `content` mediumtext,
  844. `batch` tinyint(1) NOT NULL DEFAULT 0,
  845. PRIMARY KEY(`id`),
  846. INDEX `cid` (`cid`),
  847. INDEX `created` (`created`),
  848. INDEX `last` (`last`),
  849. INDEX `network` (`network`),
  850. INDEX `batch` (`batch`)
  851. ) DEFAULT COLLATE utf8mb4_general_ci;
  852. --
  853. -- TABLE register
  854. --
  855. CREATE TABLE IF NOT EXISTS `register` (
  856. `id` int(11) unsigned NOT NULL auto_increment,
  857. `hash` varchar(255) NOT NULL DEFAULT '',
  858. `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  859. `uid` int(11) unsigned NOT NULL DEFAULT 0,
  860. `password` varchar(255) NOT NULL DEFAULT '',
  861. `language` varchar(16) NOT NULL DEFAULT '',
  862. `note` text,
  863. PRIMARY KEY(`id`)
  864. ) DEFAULT COLLATE utf8mb4_general_ci;
  865. --
  866. -- TABLE search
  867. --
  868. CREATE TABLE IF NOT EXISTS `search` (
  869. `id` int(11) NOT NULL auto_increment,
  870. `uid` int(11) NOT NULL DEFAULT 0,
  871. `term` varchar(255) NOT NULL DEFAULT '',
  872. PRIMARY KEY(`id`),
  873. INDEX `uid` (`uid`)
  874. ) DEFAULT COLLATE utf8mb4_general_ci;
  875. --
  876. -- TABLE session
  877. --
  878. CREATE TABLE IF NOT EXISTS `session` (
  879. `id` bigint(20) unsigned NOT NULL auto_increment,
  880. `sid` varbinary(255) NOT NULL DEFAULT '',
  881. `data` text,
  882. `expire` int(10) unsigned NOT NULL DEFAULT 0,
  883. PRIMARY KEY(`id`),
  884. INDEX `sid` (`sid`(64)),
  885. INDEX `expire` (`expire`)
  886. ) DEFAULT COLLATE utf8mb4_general_ci;
  887. --
  888. -- TABLE sign
  889. --
  890. CREATE TABLE IF NOT EXISTS `sign` (
  891. `id` int(10) unsigned NOT NULL auto_increment,
  892. `iid` int(10) unsigned NOT NULL DEFAULT 0,
  893. `signed_text` mediumtext,
  894. `signature` text,
  895. `signer` varchar(255) NOT NULL DEFAULT '',
  896. PRIMARY KEY(`id`),
  897. INDEX `iid` (`iid`)
  898. ) DEFAULT COLLATE utf8mb4_general_ci;
  899. --
  900. -- TABLE spam
  901. --
  902. CREATE TABLE IF NOT EXISTS `spam` (
  903. `id` int(11) NOT NULL auto_increment,
  904. `uid` int(11) NOT NULL DEFAULT 0,
  905. `spam` int(11) NOT NULL DEFAULT 0,
  906. `ham` int(11) NOT NULL DEFAULT 0,
  907. `term` varchar(255) NOT NULL DEFAULT '',
  908. `date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  909. PRIMARY KEY(`id`),
  910. INDEX `uid` (`uid`),
  911. INDEX `spam` (`spam`),
  912. INDEX `ham` (`ham`),
  913. INDEX `term` (`term`)
  914. ) DEFAULT COLLATE utf8mb4_general_ci;
  915. --
  916. -- TABLE term
  917. --
  918. CREATE TABLE IF NOT EXISTS `term` (
  919. `tid` int(10) unsigned NOT NULL auto_increment,
  920. `oid` int(10) unsigned NOT NULL DEFAULT 0,
  921. `otype` tinyint(3) unsigned NOT NULL DEFAULT 0,
  922. `type` tinyint(3) unsigned NOT NULL DEFAULT 0,
  923. `term` varchar(255) NOT NULL DEFAULT '',
  924. `url` varchar(255) NOT NULL DEFAULT '',
  925. `guid` varchar(255) NOT NULL DEFAULT '',
  926. `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  927. `received` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  928. `global` tinyint(1) NOT NULL DEFAULT 0,
  929. `aid` int(10) unsigned NOT NULL DEFAULT 0,
  930. `uid` int(10) unsigned NOT NULL DEFAULT 0,
  931. PRIMARY KEY(`tid`),
  932. INDEX `oid_otype_type_term` (`oid`,`otype`,`type`,`term`(32)),
  933. INDEX `uid_otype_type_term_global_created` (`uid`,`otype`,`type`,`term`(32),`global`,`created`),
  934. INDEX `uid_otype_type_url` (`uid`,`otype`,`type`,`url`(64)),
  935. INDEX `guid` (`guid`(64))
  936. ) DEFAULT COLLATE utf8mb4_general_ci;
  937. --
  938. -- TABLE thread
  939. --
  940. CREATE TABLE IF NOT EXISTS `thread` (
  941. `iid` int(10) unsigned NOT NULL DEFAULT 0,
  942. `uid` int(10) unsigned NOT NULL DEFAULT 0,
  943. `contact-id` int(11) unsigned NOT NULL DEFAULT 0,
  944. `gcontact-id` int(11) unsigned NOT NULL DEFAULT 0,
  945. `owner-id` int(11) unsigned NOT NULL DEFAULT 0,
  946. `author-id` int(11) unsigned NOT NULL DEFAULT 0,
  947. `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  948. `edited` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  949. `commented` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  950. `received` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  951. `changed` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  952. `wall` tinyint(1) NOT NULL DEFAULT 0,
  953. `private` tinyint(1) NOT NULL DEFAULT 0,
  954. `pubmail` tinyint(1) NOT NULL DEFAULT 0,
  955. `moderated` tinyint(1) NOT NULL DEFAULT 0,
  956. `visible` tinyint(1) NOT NULL DEFAULT 0,
  957. `spam` tinyint(1) NOT NULL DEFAULT 0,
  958. `starred` tinyint(1) NOT NULL DEFAULT 0,
  959. `ignored` tinyint(1) NOT NULL DEFAULT 0,
  960. `bookmark` tinyint(1) NOT NULL DEFAULT 0,
  961. `unseen` tinyint(1) NOT NULL DEFAULT 1,
  962. `deleted` tinyint(1) NOT NULL DEFAULT 0,
  963. `origin` tinyint(1) NOT NULL DEFAULT 0,
  964. `forum_mode` tinyint(1) NOT NULL DEFAULT 0,
  965. `mention` tinyint(1) NOT NULL DEFAULT 0,
  966. `network` varchar(32) NOT NULL DEFAULT '',
  967. PRIMARY KEY(`iid`),
  968. INDEX `uid_network_commented` (`uid`,`network`,`commented`),
  969. INDEX `uid_network_created` (`uid`,`network`,`created`),
  970. INDEX `uid_contactid_commented` (`uid`,`contact-id`,`commented`),
  971. INDEX `uid_contactid_created` (`uid`,`contact-id`,`created`),
  972. INDEX `uid_created` (`uid`,`created`),
  973. INDEX `uid_commented` (`uid`,`commented`),
  974. INDEX `uid_wall_created` (`uid`,`wall`,`created`)
  975. ) DEFAULT COLLATE utf8mb4_general_ci;
  976. --
  977. -- TABLE tokens
  978. --
  979. CREATE TABLE IF NOT EXISTS `tokens` (
  980. `id` varchar(40) NOT NULL,
  981. `secret` text,
  982. `client_id` varchar(20) NOT NULL DEFAULT '',
  983. `expires` int(11) NOT NULL DEFAULT 0,
  984. `scope` varchar(200) NOT NULL DEFAULT '',
  985. `uid` int(11) NOT NULL DEFAULT 0,
  986. PRIMARY KEY(`id`)
  987. ) DEFAULT COLLATE utf8mb4_general_ci;
  988. --
  989. -- TABLE user
  990. --
  991. CREATE TABLE IF NOT EXISTS `user` (
  992. `uid` int(11) NOT NULL auto_increment,
  993. `guid` varchar(64) NOT NULL DEFAULT '',
  994. `username` varchar(255) NOT NULL DEFAULT '',
  995. `password` varchar(255) NOT NULL DEFAULT '',
  996. `nickname` varchar(255) NOT NULL DEFAULT '',
  997. `email` varchar(255) NOT NULL DEFAULT '',
  998. `openid` varchar(255) NOT NULL DEFAULT '',
  999. `timezone` varchar(128) NOT NULL DEFAULT '',
  1000. `language` varchar(32) NOT NULL DEFAULT 'en',
  1001. `register_date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  1002. `login_date` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  1003. `default-location` varchar(255) NOT NULL DEFAULT '',
  1004. `allow_location` tinyint(1) NOT NULL DEFAULT 0,
  1005. `theme` varchar(255) NOT NULL DEFAULT '',
  1006. `pubkey` text,
  1007. `prvkey` text,
  1008. `spubkey` text,
  1009. `sprvkey` text,
  1010. `verified` tinyint(1) unsigned NOT NULL DEFAULT 0,
  1011. `blocked` tinyint(1) unsigned NOT NULL DEFAULT 0,
  1012. `blockwall` tinyint(1) unsigned NOT NULL DEFAULT 0,
  1013. `hidewall` tinyint(1) unsigned NOT NULL DEFAULT 0,
  1014. `blocktags` tinyint(1) unsigned NOT NULL DEFAULT 0,
  1015. `unkmail` tinyint(1) NOT NULL DEFAULT 0,
  1016. `cntunkmail` int(11) NOT NULL DEFAULT 10,
  1017. `notify-flags` int(11) unsigned NOT NULL DEFAULT 65535,
  1018. `page-flags` int(11) unsigned NOT NULL DEFAULT 0,
  1019. `account-type` int(11) unsigned NOT NULL DEFAULT 0,
  1020. `prvnets` tinyint(1) NOT NULL DEFAULT 0,
  1021. `pwdreset` varchar(255) NOT NULL DEFAULT '',
  1022. `maxreq` int(11) NOT NULL DEFAULT 10,
  1023. `expire` int(11) unsigned NOT NULL DEFAULT 0,
  1024. `account_removed` tinyint(1) NOT NULL DEFAULT 0,
  1025. `account_expired` tinyint(1) NOT NULL DEFAULT 0,
  1026. `account_expires_on` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  1027. `expire_notification_sent` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  1028. `service_class` varchar(32) NOT NULL DEFAULT '',
  1029. `def_gid` int(11) NOT NULL DEFAULT 0,
  1030. `allow_cid` mediumtext,
  1031. `allow_gid` mediumtext,
  1032. `deny_cid` mediumtext,
  1033. `deny_gid` mediumtext,
  1034. `openidserver` text,
  1035. PRIMARY KEY(`uid`),
  1036. INDEX `nickname` (`nickname`(32))
  1037. ) DEFAULT COLLATE utf8mb4_general_ci;
  1038. --
  1039. -- TABLE userd
  1040. --
  1041. CREATE TABLE IF NOT EXISTS `userd` (
  1042. `id` int(11) NOT NULL auto_increment,
  1043. `username` varchar(255) NOT NULL,
  1044. PRIMARY KEY(`id`),
  1045. INDEX `username` (`username`(32))
  1046. ) DEFAULT COLLATE utf8mb4_general_ci;
  1047. --
  1048. -- TABLE workerqueue
  1049. --
  1050. CREATE TABLE IF NOT EXISTS `workerqueue` (
  1051. `id` int(11) NOT NULL auto_increment,
  1052. `parameter` text,
  1053. `priority` tinyint(3) unsigned NOT NULL DEFAULT 0,
  1054. `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  1055. `pid` int(11) NOT NULL DEFAULT 0,
  1056. `executed` datetime NOT NULL DEFAULT '0001-01-01 00:00:00',
  1057. PRIMARY KEY(`id`)
  1058. ) DEFAULT COLLATE utf8mb4_general_ci;