Skip to content
Snippets Groups Projects
Commit 3d53b2c9 authored by Martin Mareš's avatar Martin Mareš
Browse files

DB: Upgrade zakládá tabulku jobs

parent 07d3b23c
No related branches found
No related tags found
1 merge request!9WIP: Zárodek uživatelské části webu a submitování
...@@ -26,3 +26,31 @@ ALTER TABLE papers ...@@ -26,3 +26,31 @@ ALTER TABLE papers
ALTER TABLE solutions ALTER TABLE solutions
RENAME COLUMN last_submit TO final_submit, RENAME COLUMN last_submit TO final_submit,
RENAME COLUMN last_feedback TO final_feedback; RENAME COLUMN last_feedback TO final_feedback;
CREATE TYPE job_type AS ENUM (
'download_submits',
'upload_feedback'
);
CREATE TYPE job_state AS ENUM (
'ready',
'running',
'done', -- Hotovo, out_json a out_file jsou platné
'failed' -- Interní chyba při zpracování, viz log
);
CREATE TABLE jobs (
job_id serial PRIMARY KEY,
type job_type NOT NULL,
state job_state NOT NULL,
user_id int NOT NULL REFERENCES users(user_id), -- komu patří
created_at timestamp with time zone NOT NULL DEFAULT CURRENT_TIMESTAMP, -- kdy byl založen
finished_at timestamp with time zone DEFAULT NULL, -- kdy doběhl
expires_at timestamp with time zone DEFAULT NULL, -- kdy bude automaticky smazán
description text NOT NULL DEFAULT '',
in_json jsonb DEFAULT NULL,
out_json jsonb DEFAULT NULL,
-- Soubory jsou součástí úlohy a po jejím ukončení budou smazány
in_file varchar(255) DEFAULT NULL,
out_file varchar(255) DEFAULT NULL
);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment