From 29991d760d8a5b8eff6d020afe3681d91c334db3 Mon Sep 17 00:00:00 2001 From: Paul-Nicolas Madelaine Date: Wed, 27 Sep 2023 18:24:41 +0200 Subject: [PATCH] (wip) --- .../migrations/00000000000000_typhon/up.sql | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/typhon/migrations/00000000000000_typhon/up.sql b/typhon/migrations/00000000000000_typhon/up.sql index 02c5e6f8..2bee5202 100644 --- a/typhon/migrations/00000000000000_typhon/up.sql +++ b/typhon/migrations/00000000000000_typhon/up.sql @@ -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,