fix(tester): fix schema&queries

This commit is contained in:
Vyacheslav1557 2025-03-08 19:01:45 +05:00
parent dd87d63860
commit ffacc9e3ac
2 changed files with 11 additions and 8 deletions

View file

@ -5,7 +5,7 @@ CREATE FUNCTION updated_at_update() RETURNS TRIGGER
$$
BEGIN
NEW.updated_at = NOW();
RETURN NEW;
RETURN NEW;
END;
$$;
@ -54,8 +54,8 @@ EXECUTE PROCEDURE updated_at_update();
CREATE TABLE IF NOT EXISTS tasks
(
id serial NOT NULL,
problem_id integer NOT NULL REFERENCES problems (id),
contest_id integer NOT NULL REFERENCES contests (id),
problem_id integer REFERENCES problems (id) ON DELETE SET NULL,
contest_id integer REFERENCES contests (id) ON DELETE SET NULL,
position integer NOT NULL,
created_at timestamptz NOT NULL DEFAULT now(),
updated_at timestamptz NOT NULL DEFAULT now(),
@ -93,8 +93,8 @@ EXECUTE PROCEDURE updated_at_update();
CREATE TABLE IF NOT EXISTS solutions
(
id serial NOT NULL,
task_id integer NOT NULL REFERENCES tasks (id),
participant_id integer NOT NULL REFERENCES participants (id),
task_id integer REFERENCES tasks (id) ON DELETE SET NULL,
participant_id integer REFERENCES participants (id) ON DELETE SET NULL,
solution varchar(1048576) NOT NULL,
state integer NOT NULL DEFAULT 1,
score integer NOT NULL,