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.
 
 
 
 
 
 

1094 lines
34 KiB

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