This commit is contained in:
Eelco Dolstra
2008-11-10 10:18:50 +00:00
parent f4a44db664
commit 8f42bf303f
16 changed files with 129 additions and 47 deletions

View File

@ -4,7 +4,7 @@ create table builds (
-- Info about the inputs.
project text not null, -- !!! foreign key
jobSet text not null, -- !!! foreign key
jobset text not null, -- !!! foreign key
attrName text not null,
-- Info about the build result.
@ -16,7 +16,10 @@ create table builds (
errorMsg text, -- error message in case of a Nix failure
startTime integer, -- in Unix time, 0 = used cached build result
stopTime integer,
system text not null
system text not null,
foreign key (project) references projects(name), -- ignored by sqlite
foreign key (project, jobset) references jobsets(project, name) -- ignored by sqlite
);
@ -28,7 +31,7 @@ create table inputs (
build integer,
job integer,
-- Copied from the jobSetInputs from which the build was created.
-- Copied from the jobsetinputs from which the build was created.
name text not null,
type text not null,
uri text,
@ -83,29 +86,29 @@ create table projects (
-- A jobset consists of a set of inputs (e.g. SVN repositories), one
-- of which contains a Nix expression containing an attribute set
-- describing build jobs.
create table jobSets (
create table jobsets (
name text not null,
project text not null,
description text,
nixExprInput text not null, -- name of the jobSetInput containing the Nix expression
nixExprInput text not null, -- name of the jobsetInput containing the Nix expression
nixExprPath text not null, -- relative path of the Nix expression
primary key (project, name),
foreign key (project) references projects(name) on delete cascade, -- ignored by sqlite
foreign key (project, name, nixExprInput) references jobSetInputs(project, job, name)
foreign key (project, name, nixExprInput) references jobsetInputs(project, job, name)
);
create table jobSetInputs (
create table jobsetInputs (
project text not null,
jobset text not null,
name text not null,
type text not null, -- "svn", "cvs", "path", "file", "string"
primary key (project, jobset, name),
foreign key (project, jobset) references jobSets(project, name) on delete cascade -- ignored by sqlite
foreign key (project, jobset) references jobsets(project, name) on delete cascade -- ignored by sqlite
);
create table jobSetInputAlts (
create table jobsetInputAlts (
project text not null,
jobset text not null,
input text not null,
@ -118,7 +121,7 @@ create table jobSetInputAlts (
value text, -- for type == 'string'
primary key (project, jobset, input, altnr),
foreign key (project, jobset, input) references jobSetInputs(project, jobset, name) on delete cascade -- ignored by sqlite
foreign key (project, jobset, input) references jobsetInputs(project, jobset, name) on delete cascade -- ignored by sqlite
);
@ -127,15 +130,21 @@ create table jobs (
timestamp integer not null, -- time this build was added to the db (in Unix time)
priority integer not null,
busy integer not null, -- true means someone is building this job now
locker text not null, -- !!! hostname/pid of the process building this job?
-- Info about the inputs.
project text not null, -- !!! foreign key
jobSet text not null, -- !!! foreign key
jobset text not null, -- !!! foreign key
attrName text not null,
-- What this job will build.
description text,
drvPath text not null,
outPath text not null,
system text not null
system text not null,
foreign key (project) references projects(name), -- ignored by sqlite
foreign key (project, jobset) references jobsets(project, name) -- ignored by sqlite
);