]> iEval git - gruntmaster-data.git/blobdiff - db.sql
Make gruntmaster-problem check also set/clear time limit overrides
[gruntmaster-data.git] / db.sql
diff --git a/db.sql b/db.sql
index 56b1a7e2c0a80d13fdcde39a0fa85422da3bd4fc..a9ea727f3e64f5f861fd03150604dfb60e50e49f 100644 (file)
--- a/db.sql
+++ b/db.sql
@@ -14,12 +14,14 @@ CREATE TABLE users (
 );
 
 CREATE TABLE contests (
-       id    TEXT PRIMARY KEY,
-       name  TEXT NOT NULL,
-       start INT  NOT NULL,
-       stop  INT  NOT NULL,
-       owner TEXT NOT NULL REFERENCES users ON DELETE CASCADE,
-       CONSTRAINT positive_duration CHECK (stop > start)
+       id          TEXT PRIMARY KEY,
+       name        TEXT NOT NULL,
+       editorial   TEXT,
+       description TEXT,
+       start       INT  NOT NULL,
+       stop        INT  NOT NULL,
+       owner       TEXT NOT NULL REFERENCES users ON DELETE CASCADE,
+       CONSTRAINT  positive_duration CHECK (stop > start)
 );
 
 CREATE TABLE contest_status (
@@ -72,6 +74,7 @@ CREATE TABLE jobs (
        format      TEXT    NOT NULL,
        private     BOOLEAN NOT NULL DEFAULT FALSE,
        problem     TEXT    NOT NULL REFERENCES problems ON DELETE CASCADE,
+       reference   INT,
        result      INT,
        result_text TEXT,
        results     TEXT,
@@ -96,6 +99,13 @@ CREATE TABLE opens (
        PRIMARY KEY (contest, problem, owner)
 );
 
+CREATE TABLE limits (
+       problem TEXT NOT NULL REFERENCES problems ON DELETE CASCADE,
+       format  TEXT NOT NULL,
+       timeout REAL NOT NULL,
+       PRIMARY KEY (problem, format)
+);
+
 CREATE TABLE table_comments (
        table_name   TEXT NOT NULL PRIMARY KEY,
        comment_text TEXT NOT NULL
@@ -116,6 +126,7 @@ INSERT INTO table_comments VALUES ('contest_problems', 'Many-to-many bridge betw
 INSERT INTO table_comments VALUES ('jobs',   'List of jobs');
 INSERT INTO table_comments VALUES ('problem_status', 'List of (problem, user, result)');
 INSERT INTO table_comments VALUES ('opens', 'List of (contest, problem, user, time when user opened problem)');
+INSERT INTO table_comments VALUES ('limits', 'Time limit overrides for certain problem/format pairs');
 
 INSERT INTO column_comments VALUES ('users', 'passphrase', 'RFC2307-encoded passphrase');
 INSERT INTO column_comments VALUES ('users', 'name', 'Full name of user');
@@ -125,6 +136,8 @@ INSERT INTO column_comments VALUES ('users', 'since', 'Unix time when this user
 
 INSERT INTO column_comments VALUES ('contests', 'start', 'Unix time when contest starts');
 INSERT INTO column_comments VALUES ('contests', 'stop', 'Unix time when contest ends');
+INSERT INTO column_comments VALUES ('contests', 'editorial', 'HTML fragment placed before the editorial');
+INSERT INTO column_comments VALUES ('contests', 'description', 'HTML fragment placed on contest page');
 
 INSERT INTO column_comments VALUES ('problems', 'author', 'Full name(s) of problem author(s)/problemsetter(s)/tester(s)/etc');
 INSERT INTO column_comments VALUES ('problems', 'writer', 'Full name(s) of statement writer(s) (DEPRECATED)');
@@ -150,6 +163,7 @@ INSERT INTO column_comments VALUES ('jobs', 'date', 'Unix time when job was subm
 INSERT INTO column_comments VALUES ('jobs', 'errors', 'Compiler errors');
 INSERT INTO column_comments VALUES ('jobs', 'extension', 'File extension of submitted program, without a leading dot');
 INSERT INTO column_comments VALUES ('jobs', 'format', 'Format (programming language) of submitted program');
+INSERT INTO column_comments VALUES ('jobs', 'reference', 'If not null, this is a reference solution that should get this result. For example, set reference=0 on jobs that should be accepted, reference=3 on jobs that should get TLE, etc');
 INSERT INTO column_comments VALUES ('jobs', 'result', 'Job result (integer constant from Gruntmaster::Daemon::Constants)');
 INSERT INTO column_comments VALUES ('jobs', 'result_text', 'Job result (human-readable text)');
 INSERT INTO column_comments VALUES ('jobs', 'results', 'Per-test results (JSON array of hashes with keys id (test number, counting from 1), result (integer constant from Gruntmaster::Daemon::Constants), result_text (human-readable text), time (execution time in decimal seconds))');
This page took 0.022537 seconds and 4 git commands to generate.