jobsetevals: refer to jobset by ID

This commit is contained in:
Graham Christensen
2021-01-25 14:51:33 -05:00
parent 99e3c83358
commit ac3e8a4a59
5 changed files with 39 additions and 60 deletions

View File

@ -440,9 +440,7 @@ create table SystemTypes (
create table JobsetEvals (
id serial primary key not null,
project text not null,
jobset text not null,
jobset_id integer not null,
errorMsg text, -- error output from the evaluator
errorTime integer, -- timestamp associated with errorMsg
@ -473,8 +471,7 @@ create table JobsetEvals (
nixExprInput text, -- name of the jobsetInput containing the Nix or Guix expression
nixExprPath text, -- relative path of the Nix or Guix expression
foreign key (project) references Projects(name) on delete cascade on update cascade,
foreign key (project, jobset) references Jobsets(project, name) on delete cascade on update cascade
foreign key (jobset_id) references Jobsets(id) on delete cascade
);
@ -629,7 +626,8 @@ create index IndexBuildOutputsPath on BuildOutputs using hash(path);
create index IndexBuildsOnKeep on Builds(keep) where keep = 1;
-- To get the most recent eval for a jobset.
create index IndexJobsetEvalsOnJobsetId on JobsetEvals(project, jobset, id desc) where hasNewBuilds = 1;
create index IndexJobsetEvalsOnJobsetId on JobsetEvals(jobset_id, id desc) where hasNewBuilds = 1;
create index IndexJobsetIdEvals on JobsetEvals(jobset_id) where hasNewBuilds = 1;
create index IndexBuildsOnNotificationPendingSince on Builds(notificationPendingSince) where notificationPendingSince is not null;