From: Steinar H. Gunderson Date: Mon, 14 Feb 2005 21:20:19 +0000 (+0000) Subject: Removed NOT NULL from score in the SQL schema. X-Git-Url: https://git.sesse.net/?p=ccbs;a=commitdiff_plain;h=503f2b80dd3991ae1c49806117294a820be39e89 Removed NOT NULL from score in the SQL schema. --- diff --git a/html/show-tournament.pl b/html/show-tournament.pl index 55bd2b4..8ff04c3 100755 --- a/html/show-tournament.pl +++ b/html/show-tournament.pl @@ -50,7 +50,6 @@ for my $score (@$scores) { if ($score->{'nick'} ne $player) { $player = $score->{'nick'}; push @$pl, { nick => $player, songs => [], total => 0 }; - } push @{$pl->[$#$pl]->{'songs'}}, { diff --git a/sql/ccbs.sql b/sql/ccbs.sql index c13c666..374af67 100644 --- a/sql/ccbs.sql +++ b/sql/ccbs.sql @@ -136,12 +136,12 @@ CREATE TABLE scores ( player INTEGER NOT NULL REFERENCES players, songnumber INTEGER NOT NULL, - song INTEGER NOT NULL REFERENCES songs, + song INTEGER REFERENCES songs, playmode VARCHAR CHECK (playmode IS NULL OR playmode IN ('single','double')), difficulty VARCHAR CHECK (difficulty IS NULL OR difficulty IN ('beginner','standard','difficult','expert','challenge')), - chosen BOOLEAN NOT NULL, - score INTEGER NOT NULL CHECK (score >= 0 AND score <= 10000), + chosen BOOLEAN, + score INTEGER CHECK (score IS NULL OR (score >= 0 AND score <= 10000)), FOREIGN KEY (song) REFERENCES songs (song), FOREIGN KEY (song, playmode, difficulty) REFERENCES songratings (song, playmode, difficulty),