From 31f68756c54423f5019fb135b7c04a246496cf5e Mon Sep 17 00:00:00 2001 From: Rob Vermaas Date: Thu, 25 Feb 2010 10:22:03 +0000 Subject: [PATCH] fix wrong dbix:class:loader generation --- src/lib/Hydra/Schema/Builds.pm | 45 +++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/src/lib/Hydra/Schema/Builds.pm b/src/lib/Hydra/Schema/Builds.pm index 60ddfcdb..de02bd01 100644 --- a/src/lib/Hydra/Schema/Builds.pm +++ b/src/lib/Hydra/Schema/Builds.pm @@ -421,8 +421,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.05003 @ 2010-02-25 10:29:41 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dsXIx+mh+etSD7zKQJ6I3A +# Created by DBIx::Class::Schema::Loader v0.05003 @ 2010-02-25 11:19:24 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:oCkX9bughWPZg6JKaOxDJA use Hydra::Helper::Nix; @@ -452,6 +452,14 @@ __PACKAGE__->belongs_to( { id => "id" }, ); +__PACKAGE__->has_one( + "actualBuildStep", + "Hydra::Schema::BuildSteps", + { 'foreign.outpath' => 'self.outpath' + , 'foreign.build' => 'self.id' + }, +); + sub addSequence { my $hydradbi = getHydraDBPath; if ($hydradbi =~ m/^dbi:Pg/) { @@ -498,30 +506,38 @@ QUERY x.nixExprPath, b.id as statusChangeId, b.timestamp as statusChangeTime from - (select project, jobset, job, system, max(id) as id + (select + (select max(id) from builds b + where + project = activeJobs.project and jobset = activeJobs.jobset + and job = activeJobs.job and system = activeJobs.system + and finished = 1 + ) as id from $activeJobs as activeJobs - natural join Builds - where finished = 1 - group by project, jobset, job, system) - as latest - natural join Builds x + ) as latest + join Builds x using (id) $joinWithStatusChange QUERY ); + + makeSource("ActiveJobs$name", "(select distinct project, jobset, job from Builds where isCurrent = 1 $constraint)"); makeSource( "LatestSucceeded$name", <