r98264 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98263‎ | r98264 | r98265 >
Date:21:35, 27 September 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
schema++ and small fix
Modified paths:
  • /trunk/extensions/Contest/Contest.sql (modified) (history)
  • /trunk/extensions/Contest/includes/Contest.class.php (modified) (history)
  • /trunk/extensions/Contest/specials/SpecialEditContest.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Contest/specials/SpecialEditContest.php
@@ -184,7 +184,7 @@
185185 $sessionField = 'contestid-' . $fields['name'];
186186
187187 if ( is_null( $fields['id'] ) && !is_null( $this->getRequest()->getSessionData( $sessionField ) ) ) {
188 - $contest->setId( $this->getRequest()->getSessionData( $sessionField ) );
 188+ $fields['id'] = $this->getRequest()->getSessionData( $sessionField );
189189 }
190190
191191 $contest = new Contest( $fields, true );
Index: trunk/extensions/Contest/includes/Contest.class.php
@@ -85,7 +85,7 @@
8686 'id' => 'id',
8787 'name' => 'str',
8888 'status' => 'int',
89 - 'submission_count' => 'int'
 89+ 'submission_count' => 'int',
9090 );
9191 }
9292
Index: trunk/extensions/Contest/Contest.sql
@@ -14,6 +14,7 @@
1515 CREATE TABLE IF NOT EXISTS /*_*/contest_contestants (
1616 contestant_id INT unsigned NOT NULL auto_increment PRIMARY KEY, -- Contestant id (unique id per user per contest)
1717 contestant_contest_id SMALLINT unsigned NOT NULL, -- Foreign key on contests.contest_id
 18+ contestant_challange_id INT unsigned NOT NULL, -- Foreign key on contest_challanges.challange_id
1819 contestant_user_id INT(10) unsigned NOT NULL, -- Foreign key on user.user_id
1920
2021 -- These fields will be copied from the user table on contest lock
@@ -23,9 +24,19 @@
2425
2526 -- Extra contestant info
2627 contestant_country VARCHAR(255) NOT NULL, -- Country of the contestant
 28+ contestant_volunteer TINYINT unsigned NOT NULL, -- If the user is interested in voluneer oportunities
 29+ contestant_wmf TINYINT unsigned NOT NULL, -- If the user is interested in a WMF job
 30+
2731 contestant_submission INT(10) unsigned NOT NULL -- TODO: file shizzle
2832 ) /*$wgDBTableOptions*/;
2933
 34+-- Challanges
 35+CREATE TABLE IF NOT EXISTS /*_*/contest_challanges (
 36+ challange_id INT unsigned NOT NULL auto_increment PRIMARY KEY, -- Challange id
 37+ challange_contest_id INT unsigned NOT NULL,
 38+ challange_text TEXT NOT NULL
 39+) /*$wgDBTableOptions*/;
 40+
3041 -- Judge votes
3142 CREATE TABLE IF NOT EXISTS /*_*/contest_votes (
3243 vote_id INT unsigned NOT NULL auto_increment PRIMARY KEY,

Status & tagging log