feat: improve problem memory&time limits

This commit is contained in:
Vyacheslav1557 2024-10-17 00:48:38 +05:00
parent 6dc8f05675
commit 568ccea09a

View file

@ -11,13 +11,13 @@ CREATE TABLE IF NOT EXISTS problems
tutorial varchar(10240) NOT NULL DEFAULT '', tutorial varchar(10240) NOT NULL DEFAULT '',
latex_summary varchar(10240) NOT NULL DEFAULT '', latex_summary varchar(10240) NOT NULL DEFAULT '',
time_limit integer NOT NULL DEFAULT 1000, time_limit integer NOT NULL DEFAULT 1000,
memory_limit integer NOT NULL DEFAULT 65536, memory_limit integer NOT NULL DEFAULT 64,
created_at timestamptz NOT NULL DEFAULT now(), created_at timestamptz NOT NULL DEFAULT now(),
updated_at timestamptz NOT NULL DEFAULT now(), updated_at timestamptz NOT NULL DEFAULT now(),
PRIMARY KEY (id), PRIMARY KEY (id),
CHECK (length(title) != 0), CHECK (length(title) != 0),
CHECK (memory_limit > 0), CHECK (memory_limit BETWEEN 4 and 1024),
CHECK (time_limit > 0) CHECK (time_limit BETWEEN 250 and 15000)
); );
CREATE TRIGGER on_problems_update CREATE TRIGGER on_problems_update