Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Odevzdávací Systém MO
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Mareš
Odevzdávací Systém MO
Merge requests
!14
Asynchronní joby
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
Asynchronní joby
mj/jobs
into
devel
Overview
0
Commits
12
Changes
2
Merged
Martin Mareš
requested to merge
mj/jobs
into
devel
4 years ago
Overview
0
Commits
12
Changes
2
0
0
Merge request reports
Viewing commit
3aec988c
Show latest version
2 files
+
60
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
3aec988c
DB: Tabulka pro asynchronní úlohy
· 3aec988c
Martin Mareš
authored
4 years ago
db/db.ddl
+
29
−
1
View file @ 3aec988c
Edit in single-file editor
Open in Web IDE
Show full file
@@ -225,4 +225,32 @@ CREATE TABLE log (
details jsonb NOT NULL -- detaily (závislé na typu)
);
-- FIXME: Indexy
-- Asynchronní úlohy
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
);
Loading