From 568ccea09a58e234ed3315f8bba835bbe63ae5a9 Mon Sep 17 00:00:00 2001 From: Vyacheslav1557 Date: Thu, 17 Oct 2024 00:48:38 +0500 Subject: [PATCH] feat: improve problem memory&time limits --- migrations/20240727123308_initial.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/migrations/20240727123308_initial.sql b/migrations/20240727123308_initial.sql index 9a2d71d..8b40b4c 100644 --- a/migrations/20240727123308_initial.sql +++ b/migrations/20240727123308_initial.sql @@ -11,13 +11,13 @@ CREATE TABLE IF NOT EXISTS problems tutorial varchar(10240) NOT NULL DEFAULT '', latex_summary varchar(10240) NOT NULL DEFAULT '', 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(), updated_at timestamptz NOT NULL DEFAULT now(), PRIMARY KEY (id), CHECK (length(title) != 0), - CHECK (memory_limit > 0), - CHECK (time_limit > 0) + CHECK (memory_limit BETWEEN 4 and 1024), + CHECK (time_limit BETWEEN 250 and 15000) ); CREATE TRIGGER on_problems_update