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.

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