fix wrong dbix:class:loader generation

This commit is contained in:
Rob Vermaas 2010-02-25 10:22:03 +00:00
parent 4dccd3c620
commit 31f68756c5

View file

@ -421,8 +421,8 @@ __PACKAGE__->has_many(
); );
# Created by DBIx::Class::Schema::Loader v0.05003 @ 2010-02-25 10:29:41 # Created by DBIx::Class::Schema::Loader v0.05003 @ 2010-02-25 11:19:24
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dsXIx+mh+etSD7zKQJ6I3A # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:oCkX9bughWPZg6JKaOxDJA
use Hydra::Helper::Nix; use Hydra::Helper::Nix;
@ -452,6 +452,14 @@ __PACKAGE__->belongs_to(
{ id => "id" }, { id => "id" },
); );
__PACKAGE__->has_one(
"actualBuildStep",
"Hydra::Schema::BuildSteps",
{ 'foreign.outpath' => 'self.outpath'
, 'foreign.build' => 'self.id'
},
);
sub addSequence { sub addSequence {
my $hydradbi = getHydraDBPath; my $hydradbi = getHydraDBPath;
if ($hydradbi =~ m/^dbi:Pg/) { if ($hydradbi =~ m/^dbi:Pg/) {
@ -498,30 +506,38 @@ QUERY
x.nixExprPath, x.nixExprPath,
b.id as statusChangeId, b.timestamp as statusChangeTime b.id as statusChangeId, b.timestamp as statusChangeTime
from 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 from $activeJobs as activeJobs
natural join Builds ) as latest
where finished = 1 join Builds x using (id)
group by project, jobset, job, system)
as latest
natural join Builds x
$joinWithStatusChange $joinWithStatusChange
QUERY QUERY
); );
makeSource("ActiveJobs$name", "(select distinct project, jobset, job from Builds where isCurrent = 1 $constraint)");
makeSource( makeSource(
"LatestSucceeded$name", "LatestSucceeded$name",
<<QUERY <<QUERY
select * select *
from 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
and exists (select 1 from buildresultinfo where id = b.id and buildstatus = 0)
) as id
from $activeJobs as activeJobs from $activeJobs as activeJobs
natural join Builds
natural join BuildResultInfo
where finished = 1 and buildStatus = 0
group by project, jobset, job, system
) as latest ) as latest
natural join Builds join Builds using (id)
QUERY QUERY
); );
} }
@ -533,4 +549,5 @@ makeQueries('ForProject', "and project = ?");
makeQueries('ForJobset', "and project = ? and jobset = ?"); makeQueries('ForJobset', "and project = ? and jobset = ?");
makeQueries('ForJob', "and project = ? and jobset = ? and job = ?"); makeQueries('ForJob', "and project = ? and jobset = ? and job = ?");
1; 1;