Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there) https://friendi.ca
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 
 
 

1109 satır
35 KiB

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