From 8be3edebbf9ca1314c57f669000cb403336f6ce1 Mon Sep 17 00:00:00 2001 From: Jaap Eldering Date: Mon, 3 Apr 2017 23:50:56 -0300 Subject: [PATCH] Allow solving times to be negative, since jury members can submit before contest start. Also, this could happen when the contest start time is changed after submissions are already made. --- sql/mysql_db_structure.sql | 8 ++++---- sql/upgrade/upgrade_5.1.0_5.2.0DEV.sql | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sql/mysql_db_structure.sql b/sql/mysql_db_structure.sql index 75f63e9e15..22d0286441 100644 --- a/sql/mysql_db_structure.sql +++ b/sql/mysql_db_structure.sql @@ -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 @@ -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'; diff --git a/sql/upgrade/upgrade_5.1.0_5.2.0DEV.sql b/sql/upgrade/upgrade_5.1.0_5.2.0DEV.sql index 97ba636f15..3aac94e7bf 100644 --- a/sql/upgrade/upgrade_5.1.0_5.2.0DEV.sql +++ b/sql/upgrade/upgrade_5.1.0_5.2.0DEV.sql @@ -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 @@ -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';