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.

1014 lines
33 KiB

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