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.
 
 
 
 
 
 

1082 lines
43 KiB

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