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,
7 KEY `vote`
(`vote_id`
,`question_id`
)
8 ) ENGINE
=MyISAM
DEFAULT CHARSET
=utf8
;
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',
22 ) ENGINE
=MyISAM
DEFAULT CHARSET
=utf8
;
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,
30 KEY `voter`
(`survey_id`
,`user_id`
)
31 ) ENGINE
=MyISAM
DEFAULT CHARSET
=utf8
;
33 # vim
: set syntax
=mysql
: