Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there)
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.

database.sql 34KB

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