mirror of
git://git.savannah.gnu.org/guix/guix-cuirass.git
synced 2023-12-14 06:03:04 +01:00
e550cb6a9a
integration. * bin/evaluate.in (fill-job): New procedure. (main): Use it to fill informations (nix-name, system) that will later be added to database. * doc/cuirass.texi (Database)[Derivation]: Add system and nix_name fields. (Database)[Builds]: Add id, status, timestamp, starttime and stoptime fields. Remove output field. (Database)[Outputs]: New table describing the build outputs. * src/cuirass/base.scm (build-packages): Add new fields to build object before adding it to database. * src/cuirass/database.scm (db-get-build, db-get-builds): New procedures to get a build by id from database and a list of builds using filter parameters respectively. * src/schema.sql (Outputs) : New table. (Derivations): Add system and nix_name columns. (Builds): Remove output column and add id, status, timestamp, starttime and stoptime columns.
64 lines
1.8 KiB
SQL
64 lines
1.8 KiB
SQL
BEGIN TRANSACTION;
|
|
|
|
CREATE TABLE Specifications (
|
|
repo_name TEXT NOT NULL PRIMARY KEY,
|
|
url TEXT NOT NULL,
|
|
load_path TEXT NOT NULL,
|
|
file TEXT NOT NULL,
|
|
proc TEXT NOT NULL,
|
|
arguments TEXT NOT NULL,
|
|
-- The following columns are optional.
|
|
branch TEXT,
|
|
tag TEXT,
|
|
revision TEXT,
|
|
no_compile_p INTEGER
|
|
);
|
|
|
|
CREATE TABLE Stamps (
|
|
specification TEXT NOT NULL PRIMARY KEY,
|
|
stamp TEXT NOT NULL,
|
|
FOREIGN KEY (specification) REFERENCES Specifications (repo_name)
|
|
);
|
|
|
|
CREATE TABLE Evaluations (
|
|
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
|
specification TEXT NOT NULL,
|
|
revision TEXT NOT NULL,
|
|
FOREIGN KEY (specification) REFERENCES Specifications (repo_name)
|
|
);
|
|
|
|
CREATE TABLE Derivations (
|
|
derivation TEXT NOT NULL,
|
|
evaluation INTEGER NOT NULL,
|
|
job_name TEXT NOT NULL,
|
|
system TEXT NOT NULL,
|
|
nix_name TEXT NOT NULL,
|
|
PRIMARY KEY (derivation, evaluation),
|
|
FOREIGN KEY (evaluation) REFERENCES Evaluations (id)
|
|
);
|
|
|
|
CREATE TABLE Outputs (
|
|
build INTEGER NOT NULL,
|
|
name TEXT NOT NULL,
|
|
path TEXT NOT NULL,
|
|
PRIMARY KEY (build, name),
|
|
FOREIGN KEY (build) REFERENCES Builds (id)
|
|
);
|
|
|
|
-- Builds are not in a one to one relationship with derivations in order to
|
|
-- keep track of non deterministic compilations.
|
|
CREATE TABLE Builds (
|
|
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
|
derivation TEXT NOT NULL,
|
|
evaluation INTEGER NOT NULL,
|
|
log TEXT NOT NULL,
|
|
status INTEGER NOT NULL,
|
|
timestamp INTEGER NOT NULL,
|
|
starttime INTEGER NOT NULL,
|
|
stoptime INTEGER NOT NULL,
|
|
FOREIGN KEY (derivation) REFERENCES Derivations (derivation),
|
|
FOREIGN KEY (evaluation) REFERENCES Evaluations (id)
|
|
);
|
|
|
|
COMMIT;
|