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.

861 lines
26 KiB

11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
10 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
10 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
10 years ago
11 years ago
11 years ago
11 years ago
11 years ago
10 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
10 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
10 years ago
11 years ago
10 years ago
11 years ago
10 years ago
11 years ago
10 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
10 years ago
10 years ago
11 years ago
10 years ago
11 years ago
10 years ago
11 years ago
10 years ago
11 years ago
10 years ago
11 years ago
10 years ago
11 years ago
10 years ago
11 years ago
10 years ago
10 years ago
10 years ago
11 years ago
10 years ago
11 years ago
10 years ago
10 years ago
10 years ago
11 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
  1. -- phpMyAdmin SQL Dump
  2. -- version 2.11.9.4
  3. -- http://www.phpmyadmin.net
  4. --
  5. SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
  6. /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  7. /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  8. /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  9. /*!40101 SET NAMES utf8 */;
  10. --
  11. --
  12. -- --------------------------------------------------------
  13. --
  14. -- Table structure for table `challenge`
  15. --
  16. CREATE TABLE IF NOT EXISTS `challenge` (
  17. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  18. `challenge` char(255) NOT NULL,
  19. `dfrn-id` char(255) NOT NULL,
  20. `expire` int(11) NOT NULL,
  21. `type` char(255) NOT NULL,
  22. `last_update` char(255) NOT NULL,
  23. PRIMARY KEY (`id`)
  24. ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
  25. -- --------------------------------------------------------
  26. CREATE TABLE IF NOT EXISTS `config` (
  27. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  28. `cat` char(255) NOT NULL,
  29. `k` char(255) NOT NULL,
  30. `v` text NOT NULL,
  31. PRIMARY KEY (`id`)
  32. ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
  33. --
  34. -- Table structure for table `contact`
  35. --
  36. CREATE TABLE IF NOT EXISTS `contact` (
  37. `id` int(11) NOT NULL AUTO_INCREMENT,
  38. `uid` int(11) NOT NULL COMMENT 'owner uid',
  39. `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  40. `self` tinyint(1) NOT NULL DEFAULT '0',
  41. `remote_self` tinyint(1) NOT NULL DEFAULT '0',
  42. `rel` tinyint(1) NOT NULL DEFAULT '0',
  43. `duplex` tinyint(1) NOT NULL DEFAULT '0',
  44. `network` char(255) NOT NULL,
  45. `name` char(255) NOT NULL,
  46. `nick` char(255) NOT NULL,
  47. `attag` char(255) NOT NULL,
  48. `photo` text NOT NULL,
  49. `thumb` text NOT NULL,
  50. `micro` text NOT NULL,
  51. `site-pubkey` text NOT NULL,
  52. `issued-id` char(255) NOT NULL,
  53. `dfrn-id` char(255) NOT NULL,
  54. `url` char(255) NOT NULL,
  55. `nurl` char(255) NOT NULL,
  56. `addr` char(255) NOT NULL,
  57. `alias` char(255) NOT NULL,
  58. `pubkey` text NOT NULL,
  59. `prvkey` text NOT NULL,
  60. `batch` char(255) NOT NULL,
  61. `request` text NOT NULL,
  62. `notify` text NOT NULL,
  63. `poll` text NOT NULL,
  64. `confirm` text NOT NULL,
  65. `poco` text NOT NULL,
  66. `aes_allow` tinyint(1) NOT NULL DEFAULT '0',
  67. `ret-aes` tinyint(1) NOT NULL DEFAULT '0',
  68. `usehub` tinyint(1) NOT NULL DEFAULT '0',
  69. `subhub` tinyint(1) NOT NULL DEFAULT '0',
  70. `hub-verify` char(255) NOT NULL,
  71. `last-update` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  72. `success_update` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  73. `name-date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  74. `uri-date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  75. `avatar-date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  76. `term-date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  77. `priority` tinyint(3) NOT NULL,
  78. `blocked` tinyint(1) NOT NULL DEFAULT '1',
  79. `readonly` tinyint(1) NOT NULL DEFAULT '0',
  80. `writable` tinyint(1) NOT NULL DEFAULT '0',
  81. `hidden` tinyint(1) NOT NULL DEFAULT '0',
  82. `pending` tinyint(1) NOT NULL DEFAULT '1',
  83. `rating` tinyint(1) NOT NULL DEFAULT '0',
  84. `reason` text NOT NULL,
  85. `closeness` tinyint(2) NOT NULL DEFAULT '99',
  86. `info` mediumtext NOT NULL,
  87. `profile-id` int(11) NOT NULL DEFAULT '0',
  88. `bdyear` CHAR( 4 ) NOT NULL COMMENT 'birthday notify flag',
  89. `bd` date NOT NULL,
  90. PRIMARY KEY (`id`),
  91. KEY `uid` (`uid`),
  92. KEY `self` (`self`),
  93. KEY `network` (`network`),
  94. KEY `name` (`name`),
  95. KEY `nick` (`nick`),
  96. KEY `attag` (`attag`),
  97. KEY `url` (`url`),
  98. KEY `nurl` (`nurl`),
  99. KEY `addr` (`addr`),
  100. KEY `batch` (`batch`),
  101. KEY `issued-id` (`issued-id`),
  102. KEY `dfrn-id` (`dfrn-id`),
  103. KEY `blocked` (`blocked`),
  104. KEY `readonly` (`readonly`),
  105. KEY `hidden` (`hidden`),
  106. KEY `pending` (`pending`),
  107. KEY `closeness` (`closeness`)
  108. ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
  109. -- --------------------------------------------------------
  110. --
  111. -- Table structure for table `group`
  112. --
  113. CREATE TABLE IF NOT EXISTS `group` (
  114. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  115. `uid` int(10) unsigned NOT NULL,
  116. `visible` tinyint(1) NOT NULL DEFAULT '0',
  117. `deleted` tinyint(1) NOT NULL DEFAULT '0',
  118. `name` char(255) NOT NULL,
  119. PRIMARY KEY (`id`)
  120. ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
  121. -- --------------------------------------------------------
  122. --
  123. -- Table structure for table `group_member`
  124. --
  125. CREATE TABLE IF NOT EXISTS `group_member` (
  126. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  127. `uid` int(10) unsigned NOT NULL,
  128. `gid` int(10) unsigned NOT NULL,
  129. `contact-id` int(10) unsigned NOT NULL,
  130. PRIMARY KEY (`id`)
  131. ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
  132. -- --------------------------------------------------------
  133. --
  134. -- Table structure for table `intro`
  135. --
  136. CREATE TABLE IF NOT EXISTS `intro` (
  137. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  138. `uid` int(10) unsigned NOT NULL,
  139. `fid` int(11) NOT NULL DEFAULT '0',
  140. `contact-id` int(11) NOT NULL,
  141. `knowyou` tinyint(1) NOT NULL,
  142. `duplex` tinyint(1) NOT NULL DEFAULT '0',
  143. `note` text NOT NULL,
  144. `hash` char(255) NOT NULL,
  145. `datetime` datetime NOT NULL,
  146. `blocked` tinyint(1) NOT NULL DEFAULT '1',
  147. `ignore` tinyint(1) NOT NULL DEFAULT '0',
  148. PRIMARY KEY (`id`)
  149. ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
  150. -- --------------------------------------------------------
  151. --
  152. -- Table structure for table `item`
  153. --
  154. CREATE TABLE IF NOT EXISTS `item` (
  155. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  156. `guid` char(64) NOT NULL,
  157. `uri` char(255) NOT NULL,
  158. `uid` int(10) unsigned NOT NULL DEFAULT '0',
  159. `contact-id` int(10) unsigned NOT NULL DEFAULT '0',
  160. `type` char(255) NOT NULL,
  161. `wall` tinyint(1) NOT NULL DEFAULT '0',
  162. `gravity` tinyint(1) NOT NULL DEFAULT '0',
  163. `parent` int(10) unsigned NOT NULL DEFAULT '0',
  164. `parent-uri` char(255) NOT NULL,
  165. `extid` char(255) NOT NULL,
  166. `thr-parent` char(255) NOT NULL,
  167. `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  168. `edited` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  169. `commented` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  170. `received` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  171. `changed` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  172. `owner-name` char(255) NOT NULL,
  173. `owner-link` char(255) NOT NULL,
  174. `owner-avatar` char(255) NOT NULL,
  175. `author-name` char(255) NOT NULL,
  176. `author-link` char(255) NOT NULL,
  177. `author-avatar` char(255) NOT NULL,
  178. `title` char(255) NOT NULL,
  179. `body` mediumtext NOT NULL,
  180. `app` char(255) NOT NULL,
  181. `verb` char(255) NOT NULL,
  182. `object-type` char(255) NOT NULL,
  183. `object` text NOT NULL,
  184. `target-type` char(255) NOT NULL,
  185. `target` text NOT NULL,
  186. `postopts` text NOT NULL,
  187. `plink` char(255) NOT NULL,
  188. `resource-id` char(255) NOT NULL,
  189. `event-id` int(10) unsigned NOT NULL,
  190. `tag` mediumtext NOT NULL,
  191. `attach` mediumtext NOT NULL,
  192. `inform` mediumtext NOT NULL,
  193. `file` mediumtext NOT NULL,
  194. `location` char(255) NOT NULL,
  195. `coord` char(255) NOT NULL,
  196. `allow_cid` mediumtext NOT NULL,
  197. `allow_gid` mediumtext NOT NULL,
  198. `deny_cid` mediumtext NOT NULL,
  199. `deny_gid` mediumtext NOT NULL,
  200. `private` tinyint(1) NOT NULL DEFAULT '0',
  201. `pubmail` tinyint(1) NOT NULL DEFAULT '0',
  202. `moderated` tinyint(1) NOT NULL DEFAULT '0',
  203. `visible` tinyint(1) NOT NULL DEFAULT '0',
  204. `spam` tinyint(1) NOT NULL DEFAULT '0',
  205. `starred` tinyint(1) NOT NULL DEFAULT '0',
  206. `bookmark` tinyint(1) NOT NULL DEFAULT '0',
  207. `unseen` tinyint(1) NOT NULL DEFAULT '1',
  208. `deleted` tinyint(1) NOT NULL DEFAULT '0',
  209. `origin` tinyint(1) NOT NULL DEFAULT '0',
  210. `forum_mode` tinyint(1) NOT NULL DEFAULT '0',
  211. `last-child` tinyint(1) unsigned NOT NULL DEFAULT '1',
  212. PRIMARY KEY (`id`),
  213. KEY `guid` (`guid`),
  214. KEY `uri` (`uri`),
  215. KEY `uid` (`uid`),
  216. KEY `contact-id` (`contact-id`),
  217. KEY `type` (`type`),
  218. KEY `parent` (`parent`),
  219. KEY `parent-uri` (`parent-uri`),
  220. KEY `extid` (`extid`),
  221. KEY `created` (`created`),
  222. KEY `edited` (`edited`),
  223. KEY `received` (`received`),
  224. KEY `moderated` (`moderated`),
  225. KEY `visible` (`visible`),
  226. KEY `spam` (`spam`),
  227. KEY `starred` (`starred`),
  228. KEY `bookmark` (`bookmark`),
  229. KEY `deleted` (`deleted`),
  230. KEY `origin` (`origin`),
  231. KEY `forum_mode` (`forum_mode`),
  232. KEY `last-child` (`last-child`),
  233. KEY `unseen` (`unseen`),
  234. KEY `wall` (`wall`),
  235. KEY `author-name` (`author-name`),
  236. KEY `author-link` (`author-link`),
  237. FULLTEXT KEY `title` (`title`),
  238. FULLTEXT KEY `body` (`body`),
  239. FULLTEXT KEY `tag` (`tag`),
  240. FULLTEXT KEY `file` (`file`),
  241. FULLTEXT KEY `allow_cid` (`allow_cid`),
  242. FULLTEXT KEY `allow_gid` (`allow_gid`),
  243. FULLTEXT KEY `deny_cid` (`deny_cid`),
  244. FULLTEXT KEY `deny_gid` (`deny_gid`)
  245. ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
  246. -- --------------------------------------------------------
  247. --
  248. -- Table structure for table `mail`
  249. --
  250. CREATE TABLE IF NOT EXISTS `mail` (
  251. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  252. `uid` int(10) unsigned NOT NULL,
  253. `guid` char(64) NOT NULL,
  254. `from-name` char(255) NOT NULL,
  255. `from-photo` char(255) NOT NULL,
  256. `from-url` char(255) NOT NULL,
  257. `contact-id` char(255) NOT NULL,
  258. `convid` int(10) unsigned NOT NULL,
  259. `title` char(255) NOT NULL,
  260. `body` mediumtext NOT NULL,
  261. `seen` tinyint(1) NOT NULL,
  262. `reply` tinyint(1) NOT NULL DEFAULT '0',
  263. `replied` tinyint(1) NOT NULL,
  264. `uri` char(255) NOT NULL,
  265. `parent-uri` char(255) NOT NULL,
  266. `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  267. PRIMARY KEY (`id`),
  268. KEY `uid` (`uid`),
  269. KEY `guid` (`guid`),
  270. KEY `convid` (`convid`),
  271. KEY `reply` (`reply`),
  272. KEY `uri` (`uri`),
  273. KEY `parent-uri` (`parent-uri`),
  274. KEY `created` (`created`)
  275. ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
  276. -- --------------------------------------------------------
  277. --
  278. -- Table structure for table `photo`
  279. --
  280. CREATE TABLE IF NOT EXISTS `photo` (
  281. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  282. `uid` int(10) unsigned NOT NULL,
  283. `contact-id` int(10) unsigned NOT NULL,
  284. `guid` char(64) NOT NULL,
  285. `resource-id` char(255) NOT NULL,
  286. `created` datetime NOT NULL,
  287. `edited` datetime NOT NULL,
  288. `title` char(255) NOT NULL,
  289. `desc` text NOT NULL,
  290. `album` char(255) NOT NULL,
  291. `filename` char(255) NOT NULL,
  292. `height` smallint(6) NOT NULL,
  293. `width` smallint(6) NOT NULL,
  294. `data` mediumblob NOT NULL,
  295. `scale` tinyint(3) NOT NULL,
  296. `profile` tinyint(1) NOT NULL DEFAULT '0',
  297. `allow_cid` mediumtext NOT NULL,
  298. `allow_gid` mediumtext NOT NULL,
  299. `deny_cid` mediumtext NOT NULL,
  300. `deny_gid` mediumtext NOT NULL,
  301. PRIMARY KEY (`id`),
  302. KEY `uid` (`uid`),
  303. KEY `resource-id` (`resource-id`),
  304. KEY `album` (`album`),
  305. KEY `scale` (`scale`),
  306. KEY `profile` (`profile`),
  307. KEY `guid` (`guid`)
  308. ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
  309. -- --------------------------------------------------------
  310. --
  311. -- Table structure for table `profile`
  312. --
  313. CREATE TABLE IF NOT EXISTS `profile` (
  314. `id` int(11) NOT NULL AUTO_INCREMENT,
  315. `uid` int(11) NOT NULL,
  316. `profile-name` char(255) NOT NULL,
  317. `is-default` tinyint(1) NOT NULL DEFAULT '0',
  318. `hide-friends` tinyint(1) NOT NULL DEFAULT '0',
  319. `name` char(255) NOT NULL,
  320. `pdesc` char(255) NOT NULL,
  321. `dob` char(32) NOT NULL DEFAULT '0000-00-00',
  322. `address` char(255) NOT NULL,
  323. `locality` char(255) NOT NULL,
  324. `region` char(255) NOT NULL,
  325. `postal-code` char(32) NOT NULL,
  326. `country-name` char(255) NOT NULL,
  327. `gender` char(32) NOT NULL,
  328. `marital` char(255) NOT NULL,
  329. `showwith` tinyint(1) NOT NULL DEFAULT '0',
  330. `with` text NOT NULL,
  331. `sexual` char(255) NOT NULL,
  332. `politic` char(255) NOT NULL,
  333. `religion` char(255) NOT NULL,
  334. `pub_keywords` text NOT NULL,
  335. `prv_keywords` text NOT NULL,
  336. `about` text NOT NULL,
  337. `summary` char(255) NOT NULL,
  338. `music` text NOT NULL,
  339. `book` text NOT NULL,
  340. `tv` text NOT NULL,
  341. `film` text NOT NULL,
  342. `interest` text NOT NULL,
  343. `romance` text NOT NULL,
  344. `work` text NOT NULL,
  345. `education` text NOT NULL,
  346. `contact` text NOT NULL,
  347. `homepage` char(255) NOT NULL,
  348. `photo` char(255) NOT NULL,
  349. `thumb` char(255) NOT NULL,
  350. `publish` tinyint(1) NOT NULL DEFAULT '0',
  351. `net-publish` tinyint(1) NOT NULL DEFAULT '0',
  352. PRIMARY KEY (`id`),
  353. FULLTEXT KEY `pub_keywords` (`pub_keywords`),
  354. FULLTEXT KEY `prv_keywords` (`prv_keywords`)
  355. ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
  356. -- --------------------------------------------------------
  357. --
  358. -- Table structure for table `profile_check`
  359. --
  360. CREATE TABLE IF NOT EXISTS `profile_check` (
  361. `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  362. `uid` int(10) unsigned NOT NULL,
  363. `cid` int(10) unsigned NOT NULL,
  364. `dfrn_id` char(255) NOT NULL,
  365. `sec` char(255) NOT NULL,
  366. `expire` int(11) NOT NULL,
  367. PRIMARY KEY (`id`)
  368. ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
  369. -- --------------------------------------------------------
  370. --
  371. -- Table structure for table `session`
  372. --
  373. CREATE TABLE IF NOT EXISTS `session` (
  374. `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  375. `sid` char(255) NOT NULL,
  376. `data` text NOT NULL,
  377. `expire` int(10) unsigned NOT NULL,
  378. PRIMARY KEY (`id`),
  379. KEY `sid` (`sid`),
  380. KEY `expire` (`expire`)
  381. ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
  382. -- --------------------------------------------------------
  383. --
  384. -- Table structure for table `user`
  385. --
  386. CREATE TABLE IF NOT EXISTS `user` (
  387. `uid` int(11) NOT NULL AUTO_INCREMENT,
  388. `guid` char(16) NOT NULL,
  389. `username` char(255) NOT NULL,
  390. `password` char(255) NOT NULL,
  391. `nickname` char(255) NOT NULL,
  392. `email` char(255) NOT NULL,
  393. `openid` char(255) NOT NULL,
  394. `timezone` char(128) NOT NULL,
  395. `language` char(32) NOT NULL DEFAULT 'en',
  396. `register_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  397. `login_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  398. `default-location` char(255) NOT NULL,
  399. `allow_location` tinyint(1) NOT NULL DEFAULT '0',
  400. `theme` char(255) NOT NULL,
  401. `pubkey` text NOT NULL,
  402. `prvkey` text NOT NULL,
  403. `spubkey` text NOT NULL,
  404. `sprvkey` text NOT NULL,
  405. `verified` tinyint(1) unsigned NOT NULL DEFAULT '0',
  406. `blocked` tinyint(1) unsigned NOT NULL DEFAULT '0',
  407. `blockwall` tinyint(1) unsigned NOT NULL DEFAULT '0',
  408. `hidewall` tinyint(1) unsigned NOT NULL DEFAULT '0',
  409. `blocktags` tinyint(1) unsigned NOT NULL DEFAULT '0',
  410. `notify-flags` int(11) unsigned NOT NULL DEFAULT '65535',
  411. `page-flags` int(11) unsigned NOT NULL DEFAULT '0',
  412. `prvnets` tinyint(1) NOT NULL DEFAULT '0',
  413. `pwdreset` char(255) NOT NULL,
  414. `maxreq` int(11) NOT NULL DEFAULT '10',
  415. `expire` int(11) unsigned NOT NULL DEFAULT '0',
  416. `account_expired` tinyint( 1 ) NOT NULL DEFAULT '0',
  417. `account_expires_on` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  418. `expire_notification_sent` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  419. `allow_cid` mediumtext NOT NULL,
  420. `allow_gid` mediumtext NOT NULL,
  421. `deny_cid` mediumtext NOT NULL,
  422. `deny_gid` mediumtext NOT NULL,
  423. `openidserver` text NOT NULL,
  424. PRIMARY KEY (`uid`),
  425. KEY `nickname` (`nickname`),
  426. KEY `account_expired` (`account_expired`),
  427. KEY `hidewall` (`hidewall`),
  428. KEY `blockwall` (`blockwall`),
  429. KEY `blocked` (`blocked`),
  430. KEY `verified` (`verified`),
  431. KEY `login_date` (`login_date`)
  432. ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
  433. CREATE TABLE IF NOT EXISTS `register` (
  434. `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  435. `hash` CHAR( 255 ) NOT NULL ,
  436. `created` DATETIME NOT NULL ,
  437. `uid` INT(11) UNSIGNED NOT NULL,
  438. `password` CHAR(255) NOT NULL,
  439. `language` CHAR(16) NOT NULL,
  440. PRIMARY KEY (`id`)
  441. ) ENGINE = MyISAM DEFAULT CHARSET=utf8;
  442. CREATE TABLE IF NOT EXISTS `clients` (
  443. `client_id` VARCHAR( 20 ) NOT NULL ,
  444. `pw` VARCHAR( 20 ) NOT NULL ,
  445. `redirect_uri` VARCHAR( 200 ) NOT NULL ,
  446. `name` VARCHAR( 128 ) NULL DEFAULT NULL,
  447. `icon` VARCHAR( 255 ) NULL DEFAULT NULL,
  448. `uid` INT NOT NULL DEFAULT 0,
  449. PRIMARY KEY ( `client_id` )
  450. ) ENGINE = MyISAM DEFAULT CHARSET=utf8;
  451. CREATE TABLE IF NOT EXISTS `tokens` (
  452. `id` VARCHAR( 40 ) NOT NULL ,
  453. `secret` VARCHAR( 40 ) NOT NULL ,
  454. `client_id` VARCHAR( 20 ) NOT NULL ,
  455. `expires` INT NOT NULL ,
  456. `scope` VARCHAR( 200 ) NOT NULL ,
  457. `uid` INT NOT NULL ,
  458. PRIMARY KEY ( `id` )
  459. ) ENGINE = MyISAM DEFAULT CHARSET=utf8;
  460. CREATE TABLE IF NOT EXISTS `auth_codes` (
  461. `id` VARCHAR( 40 ) NOT NULL ,
  462. `client_id` VARCHAR( 20 ) NOT NULL ,
  463. `redirect_uri` VARCHAR( 200 ) NOT NULL ,
  464. `expires` INT NOT NULL ,
  465. `scope` VARCHAR( 250 ) NOT NULL ,
  466. PRIMARY KEY ( `id` )
  467. ) ENGINE = MyISAM DEFAULT CHARSET=utf8;
  468. CREATE TABLE IF NOT EXISTS `queue` (
  469. `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  470. `cid` INT NOT NULL ,
  471. `network` CHAR( 32 ) NOT NULL,
  472. `created` DATETIME NOT NULL ,
  473. `last` DATETIME NOT NULL ,
  474. `content` MEDIUMTEXT NOT NULL,
  475. `batch` TINYINT( 1 ) NOT NULL DEFAULT '0',
  476. INDEX ( `cid` ),
  477. INDEX ( `created` ),
  478. INDEX ( `last` ),
  479. INDEX ( `network` ),
  480. INDEX ( `batch` )
  481. ) ENGINE = MyISAM DEFAULT CHARSET=utf8;
  482. CREATE TABLE IF NOT EXISTS `pconfig` (
  483. `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  484. `uid` INT NOT NULL DEFAULT '0',
  485. `cat` CHAR( 255 ) NOT NULL ,
  486. `k` CHAR( 255 ) NOT NULL ,
  487. `v` MEDIUMTEXT NOT NULL
  488. ) ENGINE = MyISAM DEFAULT CHARSET=utf8;
  489. CREATE TABLE IF NOT EXISTS `hook` (
  490. `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  491. `hook` CHAR( 255 ) NOT NULL ,
  492. `file` CHAR( 255 ) NOT NULL ,
  493. `function` CHAR( 255 ) NOT NULL
  494. ) ENGINE = MyISAM DEFAULT CHARSET=utf8;
  495. CREATE TABLE IF NOT EXISTS `addon` (
  496. `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  497. `name` CHAR( 255 ) NOT NULL ,
  498. `version` CHAR( 255 ) NOT NULL ,
  499. `installed` TINYINT( 1 ) NOT NULL DEFAULT '0' ,
  500. `timestamp` BIGINT NOT NULL DEFAULT '0' ,
  501. `plugin_admin` TINYINT( 1 ) NOT NULL DEFAULT '0'
  502. ) ENGINE = MyISAM DEFAULT CHARSET=utf8;
  503. CREATE TABLE IF NOT EXISTS `event` (
  504. `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  505. `uid` INT NOT NULL ,
  506. `cid` INT NOT NULL ,
  507. `uri` CHAR( 255 ) NOT NULL,
  508. `created` DATETIME NOT NULL ,
  509. `edited` DATETIME NOT NULL ,
  510. `start` DATETIME NOT NULL ,
  511. `finish` DATETIME NOT NULL ,
  512. `desc` TEXT NOT NULL ,
  513. `location` TEXT NOT NULL ,
  514. `type` CHAR( 255 ) NOT NULL ,
  515. `nofinish` TINYINT( 1 ) NOT NULL DEFAULT '0',
  516. `adjust` TINYINT( 1 ) NOT NULL DEFAULT '1',
  517. `allow_cid` MEDIUMTEXT NOT NULL ,
  518. `allow_gid` MEDIUMTEXT NOT NULL ,
  519. `deny_cid` MEDIUMTEXT NOT NULL ,
  520. `deny_gid` MEDIUMTEXT NOT NULL
  521. ) ENGINE = MyISAM DEFAULT CHARSET=utf8;
  522. CREATE TABLE IF NOT EXISTS `cache` (
  523. `k` CHAR( 255 ) NOT NULL PRIMARY KEY ,
  524. `v` TEXT NOT NULL,
  525. `updated` DATETIME NOT NULL
  526. ) ENGINE = MyISAM DEFAULT CHARSET=utf8;
  527. CREATE TABLE IF NOT EXISTS `fcontact` (
  528. `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  529. `url` CHAR( 255 ) NOT NULL ,
  530. `name` CHAR( 255 ) NOT NULL ,
  531. `photo` CHAR( 255 ) NOT NULL ,
  532. `request` CHAR( 255 ) NOT NULL,
  533. `nick` CHAR( 255 ) NOT NULL ,
  534. `addr` CHAR( 255 ) NOT NULL ,
  535. `batch` CHAR( 255) NOT NULL,
  536. `notify` CHAR( 255 ) NOT NULL ,
  537. `poll` CHAR( 255 ) NOT NULL ,
  538. `confirm` CHAR( 255 ) NOT NULL ,
  539. `priority` TINYINT( 1 ) NOT NULL ,
  540. `network` CHAR( 32 ) NOT NULL ,
  541. `alias` CHAR( 255 ) NOT NULL ,
  542. `pubkey` TEXT NOT NULL ,
  543. `updated` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
  544. INDEX ( `addr` ),
  545. INDEX ( `network` )
  546. ) ENGINE = MyISAM DEFAULT CHARSET=utf8;
  547. CREATE TABLE IF NOT EXISTS `ffinder` (
  548. `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  549. `uid` INT UNSIGNED NOT NULL ,
  550. `cid` INT UNSIGNED NOT NULL ,
  551. `fid` INT UNSIGNED NOT NULL
  552. ) ENGINE = MyISAM DEFAULT CHARSET=utf8;
  553. CREATE TABLE IF NOT EXISTS `fsuggest` (
  554. `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  555. `uid` INT NOT NULL ,
  556. `cid` INT NOT NULL ,
  557. `name` CHAR( 255 ) NOT NULL ,
  558. `url` CHAR( 255 ) NOT NULL ,
  559. `request` CHAR( 255 ) NOT NULL,
  560. `photo` CHAR( 255 ) NOT NULL ,
  561. `note` TEXT NOT NULL ,
  562. `created` DATETIME NOT NULL
  563. ) ENGINE = MyISAM DEFAULT CHARSET=utf8;
  564. CREATE TABLE IF NOT EXISTS `mailacct` (
  565. `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  566. `uid` INT NOT NULL,
  567. `server` CHAR( 255 ) NOT NULL ,
  568. `port` INT NOT NULL,
  569. `ssltype` CHAR( 16 ) NOT NULL,
  570. `mailbox` CHAR( 255 ) NOT NULL,
  571. `user` CHAR( 255 ) NOT NULL ,
  572. `pass` TEXT NOT NULL ,
  573. `reply_to` CHAR( 255 ) NOT NULL ,
  574. `action` INT NOT NULL ,
  575. `movetofolder` CHAR(255) NOT NULL ,
  576. `pubmail` TINYINT(1) NOT NULL DEFAULT '0',
  577. `last_check` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00'
  578. ) ENGINE = MyISAM DEFAULT CHARSET=utf8;
  579. CREATE TABLE IF NOT EXISTS `attach` (
  580. `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  581. `uid` INT NOT NULL ,
  582. `hash` CHAR(64) NOT NULL,
  583. `filename` CHAR(255) NOT NULL,
  584. `filetype` CHAR( 64 ) NOT NULL ,
  585. `filesize` INT NOT NULL ,
  586. `data` LONGBLOB NOT NULL ,
  587. `created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
  588. `edited` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
  589. `allow_cid` MEDIUMTEXT NOT NULL ,
  590. `allow_gid` MEDIUMTEXT NOT NULL ,
  591. `deny_cid` MEDIUMTEXT NOT NULL ,
  592. `deny_gid` MEDIUMTEXT NOT NULL
  593. ) ENGINE = MyISAM DEFAULT CHARSET=utf8;
  594. CREATE TABLE IF NOT EXISTS `guid` (
  595. `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  596. `guid` CHAR( 64 ) NOT NULL ,
  597. INDEX ( `guid` )
  598. ) ENGINE = MyISAM DEFAULT CHARSET=utf8;
  599. CREATE TABLE IF NOT EXISTS `sign` (
  600. `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  601. `iid` INT UNSIGNED NOT NULL ,
  602. `signed_text` MEDIUMTEXT NOT NULL ,
  603. `signature` TEXT NOT NULL ,
  604. `signer` CHAR( 255 ) NOT NULL ,
  605. INDEX ( `iid` )
  606. ) ENGINE = MyISAM DEFAULT CHARSET=utf8;
  607. CREATE TABLE IF NOT EXISTS `deliverq` (
  608. `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  609. `cmd` CHAR( 32 ) NOT NULL ,
  610. `item` INT NOT NULL ,
  611. `contact` INT NOT NULL
  612. ) ENGINE = MyISAM DEFAULT CHARSET=utf8;
  613. CREATE TABLE IF NOT EXISTS `search` (
  614. `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  615. `uid` INT NOT NULL ,
  616. `term` CHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  617. INDEX ( `uid` ),
  618. INDEX ( `term` )
  619. ) ENGINE = MyISAM DEFAULT CHARSET=utf8;
  620. CREATE TABLE IF NOT EXISTS `fserver` (
  621. `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  622. `server` CHAR( 255 ) NOT NULL ,
  623. `posturl` CHAR( 255 ) NOT NULL ,
  624. `key` TEXT NOT NULL,
  625. INDEX ( `server` )
  626. ) ENGINE = MyISAM DEFAULT CHARSET=utf8;
  627. CREATE TABLE IF NOT EXISTS `gcontact` (
  628. `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  629. `name` CHAR( 255 ) NOT NULL ,
  630. `url` CHAR( 255 ) NOT NULL ,
  631. `nurl` CHAR( 255 ) NOT NULL ,
  632. `photo` CHAR( 255 ) NOT NULL,
  633. `connect` CHAR( 255 ) NOT NULL,
  634. INDEX ( `nurl` )
  635. ) ENGINE = MyISAM DEFAULT CHARSET=utf8;
  636. CREATE TABLE IF NOT EXISTS `glink` (
  637. `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  638. `cid` INT NOT NULL ,
  639. `uid` INT NOT NULL ,
  640. `gcid` INT NOT NULL,
  641. `updated` DATETIME NOT NULL,
  642. INDEX ( `cid` ),
  643. INDEX ( `uid` ),
  644. INDEX ( `gcid` ),
  645. INDEX ( `updated` )
  646. ) ENGINE = MyISAM DEFAULT CHARSET=utf8;
  647. CREATE TABLE IF NOT EXISTS `gcign` (
  648. `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  649. `uid` INT NOT NULL ,
  650. `gcid` INT NOT NULL,
  651. INDEX ( `uid` ),
  652. INDEX ( `gcid` )
  653. ) ENGINE = MyISAM DEFAULT CHARSET=utf8;
  654. CREATE TABLE IF NOT EXISTS `conv` (
  655. `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  656. `guid` CHAR( 64 ) NOT NULL ,
  657. `recips` MEDIUMTEXT NOT NULL ,
  658. `uid` INT NOT NULL,
  659. `creator` CHAR( 255 ) NOT NULL ,
  660. `created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
  661. `updated` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
  662. `subject` MEDIUMTEXT NOT NULL,
  663. INDEX ( `created` ),
  664. INDEX ( `updated` )
  665. ) ENGINE = MyISAM DEFAULT CHARSET=utf8;
  666. CREATE TABLE IF NOT EXISTS `notify` (
  667. `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  668. `hash` CHAR( 64 ) NOT NULL,
  669. `type` INT( 11 ) NOT NULL ,
  670. `name` CHAR( 255 ) NOT NULL ,
  671. `url` CHAR( 255 ) NOT NULL ,
  672. `photo` CHAR( 255 ) NOT NULL ,
  673. `date` DATETIME NOT NULL ,
  674. `msg` MEDIUMTEXT NOT NULL ,
  675. `uid` INT NOT NULL ,
  676. `link` CHAR( 255 ) NOT NULL ,
  677. `parent` INT( 11 ) NOT NULL,
  678. `seen` TINYINT( 1 ) NOT NULL DEFAULT '0',
  679. `verb` CHAR( 255 ) NOT NULL,
  680. `otype` CHAR( 16 ) NOT NULL,
  681. INDEX ( `hash` ),
  682. INDEX ( `type` ),
  683. INDEX ( `uid` ),
  684. INDEX ( `link` ),
  685. INDEX ( `parent` ),
  686. INDEX ( `seen` ),
  687. INDEX ( `date` ),
  688. INDEX ( `otype` )
  689. ) ENGINE = MyISAM DEFAULT CHARSET=utf8;
  690. CREATE TABLE IF NOT EXISTS `item_id` (
  691. `iid` INT NOT NULL ,
  692. `uid` INT NOT NULL ,
  693. `face` CHAR( 255 ) NOT NULL ,
  694. `dspr` CHAR( 255 ) NOT NULL ,
  695. `twit` CHAR( 255 ) NOT NULL ,
  696. `stat` CHAR( 255 ) NOT NULL ,
  697. PRIMARY KEY ( `iid` ),
  698. INDEX ( `uid` ),
  699. INDEX ( `face` ),
  700. INDEX ( `dspr` ),
  701. INDEX ( `twit` ),
  702. INDEX ( `stat` )
  703. ) ENGINE = MyISAM DEFAULT CHARSET=utf8;
  704. CREATE TABLE IF NOT EXISTS `manage` (
  705. `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  706. `uid` INT NOT NULL ,
  707. `mid` INT NOT NULL,
  708. INDEX ( `uid` ),
  709. INDEX ( `mid` )
  710. ) ENGINE = MyISAM DEFAULT CHARSET=utf8;
  711. CREATE TABLE IF NOT EXISTS `poll_result` (
  712. `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  713. `poll_id` INT NOT NULL ,
  714. `choice` INT NOT NULL ,
  715. INDEX ( `poll_id` ),
  716. INDEX ( `choice` )
  717. ) ENGINE = MyISAM DEFAULT CHARSET=utf8;
  718. CREATE TABLE IF NOT EXISTS `poll` (
  719. `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  720. `uid` INT NOT NULL ,
  721. `q0` MEDIUMTEXT NOT NULL ,
  722. `q1` MEDIUMTEXT NOT NULL ,
  723. `q2` MEDIUMTEXT NOT NULL ,
  724. `q3` MEDIUMTEXT NOT NULL ,
  725. `q4` MEDIUMTEXT NOT NULL ,
  726. `q5` MEDIUMTEXT NOT NULL ,
  727. `q6` MEDIUMTEXT NOT NULL ,
  728. `q7` MEDIUMTEXT NOT NULL ,
  729. `q8` MEDIUMTEXT NOT NULL ,
  730. `q9` MEDIUMTEXT NOT NULL ,
  731. INDEX ( `uid` )
  732. ) ENGINE = MyISAM DEFAULT CHARSET=utf8;
  733. --
  734. -- Table structure for table `notify-threads`
  735. --
  736. -- notify-id: notify.id of the first notification of this thread
  737. -- master-parent-item: item.id of the parent item
  738. -- parent-item: item.id of the imediate parent (only for multi-thread)
  739. -- not used yet.
  740. -- receiver-uid: user.uid of the receiver of this notification.
  741. --
  742. -- If we query for a master-parent-item and receiver-uid...
  743. -- * Returns 1 item: this is not the parent notification,
  744. -- so just "follow" the thread (references to this notification)
  745. -- * Returns no item: this is the first notification related to
  746. -- this parent item. So, create the record and use the message-id
  747. -- header.
  748. CREATE TABLE IF NOT EXISTS `notify-threads` (
  749. `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  750. `notify-id` INT NOT NULL,
  751. `master-parent-item` INT( 10 ) unsigned NOT NULL DEFAULT '0',
  752. `parent-item` INT( 10 ) unsigned NOT NULL DEFAULT '0',
  753. `receiver-uid` INT NOT NULL,
  754. INDEX ( `master-parent-item` ),
  755. INDEX ( `receiver-uid` )
  756. ) ENGINE = MyISAM DEFAULT CHARSET=utf8;
  757. CREATE TABLE IF NOT EXISTS `spam` (
  758. `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
  759. `uid` INT NOT NULL,
  760. `spam` INT NOT NULL DEFAULT '0',
  761. `ham` INT NOT NULL DEFAULT '0',
  762. `term` CHAR(255) NOT NULL,
  763. `date` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
  764. INDEX ( `uid` ),
  765. INDEX ( `spam` ),
  766. INDEX ( `ham` ),
  767. INDEX ( `term` )
  768. ) ENGINE = MyISAM DEFAULT CHARSET=utf8;