Skip to content

Commit

Permalink
(wip)
Browse files Browse the repository at this point in the history
  • Loading branch information
pnmadelaine committed Sep 27, 2023
1 parent bc21311 commit 29991d7
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions typhon/migrations/00000000000000_typhon/up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,32 @@ CREATE TABLE evaluations (
evaluation_actions_path TEXT,
evaluation_flake_locked TEXT NOT NULL,
evaluation_jobset INTEGER NOT NULL REFERENCES jobsets(jobset_id) ON DELETE CASCADE,
evaluation_num INTEGER NOT NULL,
evaluation_status TEXT NOT NULL CHECK(evaluation_status in ('pending', 'success', 'error', 'canceled')),
evaluation_time_created BIGINT NOT NULL,
evaluation_time_finished BIGINT,
UNIQUE(evaluation_jobset, evaluation_num)
);

CREATE TABLE jobs (
job_id INTEGER NOT NULL PRIMARY KEY,
job_build INTEGER NOT NULL REFERENCES builds(build_id) ON DELETE CASCADE,
job_actions_pre_status TEXT CHECK(job_actions_begin_status in ('pending', 'success', 'error', 'canceled')) NOT NULL,
job_actions_pre_time_started BIGINT,
job_actions_pre_time_finished BIGINT,
job_actions_post_status TEXT CHECK(job_actions_begin_status in ('waiting', 'pending', 'success', 'error', 'canceled')) NOT NULL,
job_actions_post_time_started BIGINT,
job_actions_post_time_finished BIGINT,
job_build_drv TEXT NOT NULL,
job_build_out TEXT NOT NULL,
job_build_status TEXT CHECK(job_build_status in ('pending', 'success', 'error', 'canceled')) NOT NULL,
job_build_duration BIGINT,
job_dist BOOLEAN NOT NULL,
job_evaluation INTEGER NOT NULL REFERENCES evaluations(evaluation_id) ON DELETE CASCADE,
job_name TEXT NOT NULL,
job_status TEXT CHECK(job_status in ('begin', 'waiting', 'end', 'success', 'error', 'canceled')) NOT NULL,
job_system TEXT NOT NULL,
job_time_created BIGINT NOT NULL,
UNIQUE(job_evaluation, job_system, job_name)
);

CREATE TABLE builds (
build_id INTEGER NOT NULL PRIMARY KEY,
build_drv TEXT NOT NULL UNIQUE,
build_hash TEXT NOT NULL UNIQUE,
build_out TEXT NOT NULL UNIQUE,
build_status TEXT NOT NULL CHECK(build_status in ('pending', 'success', 'error', 'canceled'))
);

CREATE TABLE logs (
log_id INTEGER NOT NULL PRIMARY KEY,
log_evaluation INTEGER REFERENCES evaluations(evaluation_id) ON DELETE CASCADE,
Expand Down

0 comments on commit 29991d7

Please sign in to comment.