]> iEval git - gruntmaster-data.git/blobdiff - db.sql
Simplify problem_list condition
[gruntmaster-data.git] / db.sql
diff --git a/db.sql b/db.sql
index 2ef5105b4c56f4ce8a32331a490082d8a950e98d..706265ea6b49f0eff9ce6f6c220b6e74ad86d0e6 100644 (file)
--- a/db.sql
+++ b/db.sql
@@ -9,16 +9,19 @@ CREATE TABLE users (
        university TEXT,  -- NOT NULL,
        level      TEXT,  -- NOT NULL,
        country    TEXT,
-       lastjob    BIGINT
+       lastjob    BIGINT,
+       since      BIGINT DEFAULT CAST(EXTRACT(epoch from now()) AS bigint)
 );
 
 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 (
@@ -45,6 +48,7 @@ CREATE TABLE problems (
        solution  TEXT ,
        statement TEXT    NOT NULL,
        testcnt   INT     NOT NULL,
+       precnt    INT,
        tests     TEXT,
        timeout   REAL    NOT NULL,
        value     INT     NOT NULL,
@@ -119,9 +123,12 @@ INSERT INTO column_comments VALUES ('users', 'passphrase', 'RFC2307-encoded pass
 INSERT INTO column_comments VALUES ('users', 'name', 'Full name of user');
 INSERT INTO column_comments VALUES ('users', 'level', 'Highschool, Undergraduate, Master, Doctorate or Other');
 INSERT INTO column_comments VALUES ('users', 'lastjob', 'Unix time when this user last submitted a job');
+INSERT INTO column_comments VALUES ('users', 'since', 'Unix time when this user was created');
 
 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)');
@@ -134,6 +141,7 @@ INSERT INTO column_comments VALUES ('problems', 'timeout', 'Time limit (in secon
 INSERT INTO column_comments VALUES ('problems', 'solution', 'Solution (HTML)');
 INSERT INTO column_comments VALUES ('problems', 'statement', 'Statement (HTML)');
 INSERT INTO column_comments VALUES ('problems', 'testcnt', 'Number of tests');
+INSERT INTO column_comments VALUES ('problems', 'precnt', 'Number of pretests. NULL indicates full feedback.');
 INSERT INTO column_comments VALUES ('problems', 'tests', 'JSON array of test values for ::Runner::File');
 INSERT INTO column_comments VALUES ('problems', 'value', 'Problem value when used in a contest.');
 INSERT INTO column_comments VALUES ('problems', 'genformat', 'Format (programming language) of the generator if using the Run generator');
This page took 0.024874 seconds and 4 git commands to generate.