X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;ds=sidebyside;f=upgrade%2F0.9.14%2F07_survey.sql;h=2e0927cced95996736dc204b614b10b0afc8c585;hb=2dcac0f527e8207d754af8974d81b2bce3f433d9;hp=f2d24bbadc91c870736aacf4ea8bd097987070a2;hpb=1af8f55d45abf04bc0cf1a8ae368ac7f82215192;p=platal.git diff --git a/upgrade/0.9.14/07_survey.sql b/upgrade/0.9.14/07_survey.sql index f2d24bb..2e0927c 100644 --- a/upgrade/0.9.14/07_survey.sql +++ b/upgrade/0.9.14/07_survey.sql @@ -1,33 +1,35 @@ CREATE TABLE `survey_answers` ( `id` smallint(5) unsigned NOT NULL auto_increment, - `survey_id` smallint(4) unsigned NOT NULL, `vote_id` smallint(5) unsigned NOT NULL, `question_id` smallint(3) unsigned NOT NULL, `answer` text NOT NULL, PRIMARY KEY (`id`), - UNIQUE KEY `vote` (`survey_id`,`vote_id`,`question_id`) + KEY `vote` (`vote_id`,`question_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; -CREATE TABLE `survey_questions` ( - `survey_id` smallint(4) unsigned NOT NULL auto_increment, +CREATE TABLE `survey_surveys` ( + `id` smallint(4) unsigned NOT NULL auto_increment, `questions` mediumtext NOT NULL, `title` varchar(255) NOT NULL, `description` text NOT NULL, `author_id` smallint(5) unsigned NOT NULL, `end` date NOT NULL default '0000-00-00', + `mode` tinyint(2) unsigned NOT NULL default '0', `promos` varchar(255) NOT NULL, - `valid` tinyint(1) unsigned NOT NULL default '0', - PRIMARY KEY (`survey_id`) + PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; CREATE TABLE `survey_votes` ( - `id` smallint(4) unsigned NOT NULL auto_increment, + `id` smallint(5) unsigned NOT NULL auto_increment, `survey_id` smallint(4) unsigned NOT NULL, `user_id` smallint(5) unsigned NOT NULL, PRIMARY KEY (`id`), - UNIQUE KEY `voter` (`survey_id`,`user_id`) + KEY `voter` (`survey_id`,`user_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +ALTER TABLE `requests_answers` MODIFY `category` enum('alias','liste','usage','photo','evts','marketing','orange','homonyme','nl','paiements','medal','broken','surveys') NOT NULL default 'alias'; + # vim: set syntax=mysql: