Merge the BuildResultInfo table into the Builds table
This commit is contained in:
@ -163,18 +163,10 @@ create table Builds (
|
||||
disabled integer not null default 0, -- !!! boolean
|
||||
|
||||
startTime integer, -- if busy, time we started
|
||||
stopTime integer,
|
||||
|
||||
foreign key (project) references Projects(name) on update cascade,
|
||||
foreign key (project, jobset) references Jobsets(project, name) on update cascade,
|
||||
foreign key (project, jobset, job) references Jobs(project, jobset, name) on update cascade
|
||||
);
|
||||
|
||||
|
||||
-- Info for a finished build.
|
||||
create table BuildResultInfo (
|
||||
id integer primary key not null,
|
||||
|
||||
isCachedBuild integer not null, -- boolean
|
||||
-- Information about finished builds.
|
||||
isCachedBuild integer, -- boolean
|
||||
|
||||
-- Status codes:
|
||||
-- 0 = succeeded
|
||||
@ -187,23 +179,17 @@ create table BuildResultInfo (
|
||||
|
||||
errorMsg text, -- error message in case of a Nix failure
|
||||
|
||||
startTime integer, -- in Unix time, 0 = used cached build result
|
||||
stopTime integer,
|
||||
|
||||
logfile text, -- the path of the logfile
|
||||
|
||||
logsize bigint not null default 0,
|
||||
size bigint not null default 0,
|
||||
closuresize bigint not null default 0,
|
||||
logSize bigint,
|
||||
size bigint,
|
||||
closureSize bigint,
|
||||
|
||||
releaseName text, -- e.g. "patchelf-0.5pre1234"
|
||||
|
||||
keep integer not null default 0, -- true means never garbage-collect the build output
|
||||
|
||||
failedDepBuild integer, -- obsolete
|
||||
failedDepStepNr integer, -- obsolete
|
||||
|
||||
foreign key (id) references Builds(id) on delete cascade
|
||||
foreign key (project) references Projects(name) on update cascade,
|
||||
foreign key (project, jobset) references Jobsets(project, name) on update cascade,
|
||||
foreign key (project, jobset, job) references Jobs(project, jobset, name) on update cascade
|
||||
);
|
||||
|
||||
|
||||
|
@ -4,12 +4,16 @@ alter table Builds
|
||||
add column locker text,
|
||||
add column logfile text,
|
||||
add column disabled integer not null default 0,
|
||||
add column startTime integer;
|
||||
|
||||
--alter table Builds
|
||||
-- add column isCachedBuild integer,
|
||||
-- add column buildStatus integer,
|
||||
-- add column errorMsg text;
|
||||
add column startTime integer,
|
||||
add column stopTime integer,
|
||||
add column isCachedBuild integer,
|
||||
add column buildStatus integer,
|
||||
add column errorMsg text,
|
||||
add column logSize bigint,
|
||||
add column size bigint,
|
||||
add column closureSize bigint,
|
||||
add column releaseName text,
|
||||
add column keep integer not null default 0;
|
||||
|
||||
update Builds b set
|
||||
priority = (select priority from BuildSchedulingInfo s where s.id = b.id),
|
||||
@ -21,6 +25,17 @@ update Builds b set
|
||||
|
||||
update Builds b set
|
||||
startTime = ((select startTime from BuildSchedulingInfo s where s.id = b.id) union (select startTime from BuildResultInfo r where r.id = b.id));
|
||||
-- isCachedBuild = (select isCachedBuild from BuildResultInfo r where r.id = b.id),
|
||||
-- buildStatus = (select buildStatus from BuildResultInfo r where r.id = b.id),
|
||||
-- errorMsg = (select errorMsg from BuildResultInfo r where r.id = b.id);
|
||||
|
||||
update Builds b set
|
||||
isCachedBuild = (select isCachedBuild from BuildResultInfo r where r.id = b.id),
|
||||
buildStatus = (select buildStatus from BuildResultInfo r where r.id = b.id),
|
||||
errorMsg = (select errorMsg from BuildResultInfo r where r.id = b.id),
|
||||
startTime = (select startTime from BuildResultInfo r where r.id = b.id),
|
||||
stopTime = (select stopTime from BuildResultInfo r where r.id = b.id),
|
||||
logfile = (select logfile from BuildResultInfo r where r.id = b.id),
|
||||
logSize = (select logsize from BuildResultInfo r where r.id = b.id),
|
||||
size = (select size from BuildResultInfo r where r.id = b.id),
|
||||
closureSize = (select closuresize from BuildResultInfo r where r.id = b.id),
|
||||
releaseName = (select releaseName from BuildResultInfo r where r.id = b.id),
|
||||
keep = (select keep from BuildResultInfo r where r.id = b.id)
|
||||
where exists (select 1 from BuildResultInfo r where r.id = b.id);
|
||||
|
Reference in New Issue
Block a user