Index: trunk/extensions/Contest/Contest.sql |
— | — | @@ -5,28 +5,40 @@ |
6 | 6 | -- Contests |
7 | 7 | CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/contests ( |
8 | 8 | contest_id SMALLINT unsigned NOT NULL auto_increment PRIMARY KEY, |
9 | | - contest_name VARCHAR(255) NOT NULL, -- String indentifier for the Contest |
10 | | - contest_enabled TINYINT NOT NULL default '0', -- If the survey can be taken by users |
| 9 | + contest_name VARCHAR(255) NOT NULL, -- String indentifier for the contest |
| 10 | + contest_enabled TINYINT NOT NULL default '0', -- If the contest can be taken by users |
| 11 | + contest_submission_count SMALLINT unsigned NOT NULL -- |
11 | 12 | ) /*$wgDBTableOptions*/; |
12 | 13 | |
13 | 14 | -- Contestants |
14 | 15 | CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/contest_contestants ( |
15 | | - contestant_id INT(10) unsigned NOT NULL auto_increment PRIMARY KEY, |
16 | | - contestant_contest_id SMALLINT unsigned NOT NULL, |
17 | | - contestant_user_id INT(10) unsigned NOT NULL, |
| 16 | + contestant_id INT(10) unsigned NOT NULL auto_increment PRIMARY KEY, -- Contestant id (unique id per user per contest) |
| 17 | + contestant_contest_id SMALLINT unsigned NOT NULL, -- Foreign key on contests.contest_id |
| 18 | + contestant_user_id INT(10) unsigned NOT NULL, -- Foreign key on user.user_id |
18 | 19 | |
19 | | - contestant_full_name VARCHAR(255) NOT NULL, |
20 | | - contestant_user_name VARCHAR(255) NOT NULL, |
21 | | - contestant_email TINYBLOB NOT NULL, |
| 20 | + -- These fields will be copied from the user table on contest lock |
| 21 | + contestant_full_name VARCHAR(255) NOT NULL, -- Full name of the contestant |
| 22 | + contestant_user_name VARCHAR(255) NOT NULL, -- User name of the contestant |
| 23 | + contestant_email TINYBLOB NOT NULL, -- Email of the contestant |
22 | 24 | |
23 | | - contestant_country VARCHAR(255) NOT NULL, |
24 | | - contestant_submission INT(10) unsigned NOT NULL, -- TODO |
| 25 | + -- Extra contestant info |
| 26 | + contestant_country VARCHAR(255) NOT NULL, -- Country of the contestant |
| 27 | + contestant_submission INT(10) unsigned NOT NULL -- TODO: file shizzle |
25 | 28 | ) /*$wgDBTableOptions*/; |
26 | 29 | |
27 | 30 | -- Judge votes |
28 | 31 | CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/contest_votes ( |
29 | 32 | vote_id INT(10) unsigned NOT NULL auto_increment PRIMARY KEY, |
30 | | - vote_contest_id SMALLINT unsigned NOT NULL, |
31 | | - vote_contestant_id INT(10) unsigned NOT NULL, |
32 | | - vote_user_id INT(10) unsigned NOT NULL, |
| 33 | + vote_contestant_id INT(10) unsigned NOT NULL, -- Foreign key on contest_contestants.contestant_id |
| 34 | + vote_user_id INT(10) unsigned NOT NULL, -- Judge user id |
| 35 | + vote_value SMALLINT NOT NULL -- The value of the vote |
| 36 | +) /*$wgDBTableOptions*/; |
| 37 | + |
| 38 | +-- Judge comments |
| 39 | +CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/contest_comments ( |
| 40 | + comment_id INT(10) unsigned NOT NULL auto_increment PRIMARY KEY, |
| 41 | + comment_contestant_id INT(10) unsigned NOT NULL, -- Foreign key on contest_contestants.contestant_id |
| 42 | + comment_user_id INT(10) unsigned NOT NULL, -- Judge user id |
| 43 | + comment_text TEXT NOT NULL, -- The comment text |
| 44 | + comment_time CHAR(14) binary NOT NULL default '' -- The time at which the comment was made |
33 | 45 | ) /*$wgDBTableOptions*/; |
\ No newline at end of file |