2008-10-10 16:05:05 +00:00
|
|
|
create table builds (
|
2008-10-28 10:18:03 +00:00
|
|
|
id integer primary key autoincrement not null,
|
|
|
|
timestamp integer not null, -- time this build was added to the db (in Unix time)
|
2008-11-04 18:23:28 +00:00
|
|
|
|
|
|
|
-- Info about the inputs.
|
|
|
|
project text not null, -- !!! foreign key
|
|
|
|
jobSet text not null, -- !!! foreign key
|
|
|
|
attrName text not null,
|
|
|
|
|
|
|
|
-- !!! list all the inputs / arguments
|
|
|
|
|
|
|
|
-- Info about the build result.
|
2008-10-10 16:05:05 +00:00
|
|
|
description text,
|
2008-10-28 10:18:03 +00:00
|
|
|
drvPath text not null,
|
|
|
|
outPath text not null,
|
2008-10-28 17:08:29 +00:00
|
|
|
isCachedBuild integer not null, -- boolean
|
|
|
|
buildStatus integer, -- 0 = succeeded, 1 = Nix build failure, 2 = positive build failure
|
|
|
|
errorMsg text, -- error message in case of a Nix failure
|
|
|
|
startTime integer, -- in Unix time, 0 = used cached build result
|
2008-11-06 18:26:29 +00:00
|
|
|
stopTime integer,
|
|
|
|
system text not null
|
2008-10-10 16:05:05 +00:00
|
|
|
);
|
2008-10-28 10:18:03 +00:00
|
|
|
|
|
|
|
|
2008-11-05 06:23:41 +00:00
|
|
|
create table buildInputs (
|
|
|
|
buildId integer not null,
|
2008-11-05 23:08:16 +00:00
|
|
|
|
2008-11-05 06:23:41 +00:00
|
|
|
-- Copied from the jobSetInputs from which the build was created.
|
|
|
|
name text not null,
|
|
|
|
type text not null,
|
|
|
|
uri text,
|
|
|
|
revision integer,
|
|
|
|
tag text,
|
2008-11-06 18:26:29 +00:00
|
|
|
value text,
|
2008-11-05 23:08:16 +00:00
|
|
|
inputId integer, -- build ID of the input, for type == 'build'
|
|
|
|
|
2008-11-06 18:26:29 +00:00
|
|
|
path text,
|
2008-11-05 23:08:16 +00:00
|
|
|
|
2008-11-05 06:23:41 +00:00
|
|
|
primary key (buildId, name),
|
|
|
|
foreign key (buildId) references builds(id) on delete cascade -- ignored by sqlite
|
2008-11-05 23:08:16 +00:00
|
|
|
foreign key (inputId) references builds(id) -- ignored by sqlite
|
2008-11-05 06:23:41 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
|
2008-10-28 10:18:03 +00:00
|
|
|
create table buildProducts (
|
|
|
|
buildId integer not null,
|
|
|
|
type text not null, -- "nix-build", "file", "doc", "report", ...
|
|
|
|
subtype text not null, -- "sources", "rpm", ...
|
|
|
|
path text not null,
|
|
|
|
primary key (buildId, type, subType),
|
|
|
|
foreign key (buildId) references builds(id) on delete cascade -- ignored by sqlite
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
create table buildLogs (
|
|
|
|
buildId integer not null,
|
|
|
|
logPhase text not null,
|
|
|
|
path text not null,
|
|
|
|
type text not null,
|
|
|
|
primary key (buildId, logPhase),
|
|
|
|
foreign key (buildId) references builds(id) on delete cascade -- ignored by sqlite
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
-- Emulate "on delete cascade" foreign key constraints.
|
|
|
|
create trigger cascadeBuildDeletion
|
|
|
|
before delete on builds
|
|
|
|
for each row begin
|
2008-11-05 06:23:41 +00:00
|
|
|
delete from buildInputs where buildId = old.id;
|
2008-10-28 10:18:03 +00:00
|
|
|
delete from buildLogs where buildId = old.id;
|
|
|
|
delete from buildProducts where buildId = old.id;
|
|
|
|
end;
|
2008-11-04 18:23:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
create table projects (
|
|
|
|
name text primary key not null
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
-- 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 (
|
|
|
|
name text not null,
|
|
|
|
project text not null,
|
|
|
|
description text,
|
|
|
|
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)
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
create table jobSetInputs (
|
|
|
|
project text not null,
|
2008-11-06 18:26:29 +00:00
|
|
|
jobset text not null,
|
2008-11-04 18:23:28 +00:00
|
|
|
name text not null,
|
2008-11-06 18:26:29 +00:00
|
|
|
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
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
create table jobSetInputAlts (
|
|
|
|
project text not null,
|
|
|
|
jobset text not null,
|
|
|
|
input text not null,
|
|
|
|
altnr integer,
|
|
|
|
|
|
|
|
-- urgh
|
2008-11-04 18:23:28 +00:00
|
|
|
uri text,
|
2008-11-06 18:26:29 +00:00
|
|
|
revision integer, -- for type == 'svn'
|
|
|
|
tag text, -- for type == 'cvs'
|
|
|
|
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
|
2008-11-04 18:23:28 +00:00
|
|
|
);
|