first view of the results of a survey
[platal.git] / upgrade / 0.9.14 / 07_survey.sql
1 CREATE TABLE `survey_answers` (
2 `id` smallint(5) unsigned NOT NULL auto_increment,
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`),
7 KEY `vote` (`vote_id`,`question_id`)
8 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
9
10
11 CREATE TABLE `survey_surveys` (
12 `id` smallint(4) unsigned NOT NULL auto_increment,
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',
18 `mode` tinyint(2) unsigned NOT NULL default '0',
19 `promos` varchar(255) NOT NULL,
20 `valid` tinyint(1) unsigned NOT NULL default '0',
21 PRIMARY KEY (`id`)
22 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
23
24
25 CREATE TABLE `survey_votes` (
26 `id` smallint(5) unsigned NOT NULL auto_increment,
27 `survey_id` smallint(4) unsigned NOT NULL,
28 `user_id` smallint(5) unsigned NOT NULL,
29 PRIMARY KEY (`id`),
30 KEY `voter` (`survey_id`,`user_id`)
31 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
32
33 # vim: set syntax=mysql: