Skip to content

Commit

Permalink
Allow solving times to be negative, since jury members can submit
Browse files Browse the repository at this point in the history
before contest start. Also, this could happen when the contest
start time is changed after submissions are already made.
  • Loading branch information
eldering committed Apr 4, 2017
1 parent ecb55df commit 8be3ede
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions sql/mysql_db_structure.sql
Expand Up @@ -323,9 +323,9 @@ CREATE TABLE `rankcache` (
`cid` int(4) unsigned NOT NULL COMMENT 'Contest ID',
`teamid` int(4) unsigned NOT NULL COMMENT 'Team ID',
`points_restricted` int(4) unsigned NOT NULL DEFAULT '0' COMMENT 'Total correctness points (restricted audience)',
`totaltime_restricted` int(4) unsigned NOT NULL DEFAULT '0' COMMENT 'Total penalty time in minutes (restricted audience)',
`totaltime_restricted` int(4) NOT NULL DEFAULT '0' COMMENT 'Total penalty time in minutes (restricted audience)',
`points_public` int(4) unsigned NOT NULL DEFAULT '0' COMMENT 'Total correctness points (public)',
`totaltime_public` int(4) unsigned NOT NULL DEFAULT '0' COMMENT 'Total penalty time in minutes (public)',
`totaltime_public` int(4) NOT NULL DEFAULT '0' COMMENT 'Total penalty time in minutes (public)',
PRIMARY KEY (`cid`,`teamid`),
KEY `order_restricted` (`cid`,`points_restricted`,`totaltime_restricted`) USING BTREE,
KEY `order_public` (`cid`,`points_public`,`totaltime_public`) USING BTREE
Expand Down Expand Up @@ -371,11 +371,11 @@ CREATE TABLE `scorecache` (
`probid` int(4) unsigned NOT NULL COMMENT 'Problem ID',
`submissions_restricted` int(4) unsigned NOT NULL DEFAULT '0' COMMENT 'Number of submissions made (restricted audiences)',
`pending_restricted` int(4) unsigned NOT NULL DEFAULT '0' COMMENT 'Number of submissions pending judgement (restricted audience)',
`solvetime_restricted` decimal(32,9) unsigned NOT NULL DEFAULT '0.000000000' COMMENT 'Seconds into contest when problem solved (restricted audience)',
`solvetime_restricted` decimal(32,9) NOT NULL DEFAULT '0.000000000' COMMENT 'Seconds into contest when problem solved (restricted audience)',
`is_correct_restricted` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT 'Has there been a correct submission? (restricted audience)',
`submissions_public` int(4) unsigned NOT NULL DEFAULT '0' COMMENT 'Number of submissions made (public)',
`pending_public` int(4) unsigned NOT NULL DEFAULT '0' COMMENT 'Number of submissions pending judgement (public)',
`solvetime_public` decimal(32,9) unsigned NOT NULL DEFAULT '0.000000000' COMMENT 'Seconds into contest when problem solved (public)',
`solvetime_public` decimal(32,9) NOT NULL DEFAULT '0.000000000' COMMENT 'Seconds into contest when problem solved (public)',
`is_correct_public` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT 'Has there been a correct submission? (public)',
PRIMARY KEY (`cid`,`teamid`,`probid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Scoreboard cache';
Expand Down
8 changes: 4 additions & 4 deletions sql/upgrade/upgrade_5.1.0_5.2.0DEV.sql
Expand Up @@ -34,9 +34,9 @@ CREATE TABLE `rankcache` (
`cid` int(4) unsigned NOT NULL COMMENT 'Contest ID',
`teamid` int(4) unsigned NOT NULL COMMENT 'Team ID',
`points_restricted` int(4) unsigned NOT NULL DEFAULT '0' COMMENT 'Total correctness points (restricted audience)',
`totaltime_restricted` int(4) unsigned NOT NULL DEFAULT '0' COMMENT 'Total penalty time in minutes (restricted audience)',
`totaltime_restricted` int(4) NOT NULL DEFAULT '0' COMMENT 'Total penalty time in minutes (restricted audience)',
`points_public` int(4) unsigned NOT NULL DEFAULT '0' COMMENT 'Total correctness points (public)',
`totaltime_public` int(4) unsigned NOT NULL DEFAULT '0' COMMENT 'Total penalty time in minutes (public)',
`totaltime_public` int(4) NOT NULL DEFAULT '0' COMMENT 'Total penalty time in minutes (public)',
PRIMARY KEY (`cid`,`teamid`),
KEY `order_restricted` (`cid`,`points_restricted`,`totaltime_restricted`) USING BTREE,
KEY `order_public` (`cid`,`points_public`,`totaltime_public`) USING BTREE
Expand All @@ -48,11 +48,11 @@ CREATE TABLE `scorecache` (
`probid` int(4) unsigned NOT NULL COMMENT 'Problem ID',
`submissions_restricted` int(4) unsigned NOT NULL DEFAULT '0' COMMENT 'Number of submissions made (restricted audiences)',
`pending_restricted` int(4) unsigned NOT NULL DEFAULT '0' COMMENT 'Number of submissions pending judgement (restricted audience)',
`solvetime_restricted` decimal(32,9) unsigned NOT NULL DEFAULT '0.000000000' COMMENT 'Seconds into contest when problem solved (restricted audience)',
`solvetime_restricted` decimal(32,9) NOT NULL DEFAULT '0.000000000' COMMENT 'Seconds into contest when problem solved (restricted audience)',
`is_correct_restricted` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT 'Has there been a correct submission? (restricted audience)',
`submissions_public` int(4) unsigned NOT NULL DEFAULT '0' COMMENT 'Number of submissions made (public)',
`pending_public` int(4) unsigned NOT NULL DEFAULT '0' COMMENT 'Number of submissions pending judgement (public)',
`solvetime_public` decimal(32,9) unsigned NOT NULL DEFAULT '0.000000000' COMMENT 'Seconds into contest when problem solved (public)',
`solvetime_public` decimal(32,9) NOT NULL DEFAULT '0.000000000' COMMENT 'Seconds into contest when problem solved (public)',
`is_correct_public` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT 'Has there been a correct submission? (public)',
PRIMARY KEY (`cid`,`teamid`,`probid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Scoreboard cache';
Expand Down

0 comments on commit 8be3ede

Please sign in to comment.