first view of the results of a survey
[platal.git] / upgrade / 0.9.14 / 07_survey.sql
CommitLineData
1af8f55d 1CREATE TABLE `survey_answers` (
2 `id` smallint(5) unsigned NOT NULL auto_increment,
1af8f55d 3 `vote_id` smallint(5) unsigned NOT NULL,
4 `question_id` smallint(3) unsigned NOT NULL,
5 `answer` text NOT NULL,
6 PRIMARY KEY (`id`),
9f01f40b 7 KEY `vote` (`vote_id`,`question_id`)
1af8f55d 8) ENGINE=MyISAM DEFAULT CHARSET=utf8;
9
10
9fb47284 11CREATE TABLE `survey_surveys` (
12 `id` smallint(4) unsigned NOT NULL auto_increment,
1af8f55d 13 `questions` mediumtext NOT NULL,
14 `title` varchar(255) NOT NULL,
15 `description` text NOT NULL,
16 `author_id` smallint(5) unsigned NOT NULL,
17 `end` date NOT NULL default '0000-00-00',
9fb47284 18 `mode` tinyint(2) unsigned NOT NULL default '0',
1af8f55d 19 `promos` varchar(255) NOT NULL,
20 `valid` tinyint(1) unsigned NOT NULL default '0',
9fb47284 21 PRIMARY KEY (`id`)
1af8f55d 22) ENGINE=MyISAM DEFAULT CHARSET=utf8;
23
24
25CREATE TABLE `survey_votes` (
9fb47284 26 `id` smallint(5) unsigned NOT NULL auto_increment,
1af8f55d 27 `survey_id` smallint(4) unsigned NOT NULL,
28 `user_id` smallint(5) unsigned NOT NULL,
29 PRIMARY KEY (`id`),
9f01f40b 30 KEY `voter` (`survey_id`,`user_id`)
1af8f55d 31) ENGINE=MyISAM DEFAULT CHARSET=utf8;
32
33# vim: set syntax=mysql: