forked from lix-project/hydra
sequence fix for postgresql
This commit is contained in:
parent
27c7a7bc39
commit
e457be469c
|
@ -37,13 +37,18 @@ __PACKAGE__->belongs_to("dependency", "Hydra::Schema::Builds", { id => "dependen
|
||||||
|
|
||||||
use Hydra::Helper::Nix;
|
use Hydra::Helper::Nix;
|
||||||
|
|
||||||
if (getHydraDBPath =~ m/^dbi:Pg/) {
|
|
||||||
__PACKAGE__->sequence('builds_id_seq');
|
|
||||||
}
|
|
||||||
|
|
||||||
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-13 13:33:20
|
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2009-03-13 13:33:20
|
||||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:uxfS8+GnU06sbx6nvWzTSQ
|
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:uxfS8+GnU06sbx6nvWzTSQ
|
||||||
|
|
||||||
|
sub addSequence {
|
||||||
|
my $hydradbi = getHydraDBPath ;
|
||||||
|
if ($hydradbi =~ m/^dbi:Pg/) {
|
||||||
|
__PACKAGE__->sequence('builds_id_seq');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
addSequence ;
|
||||||
|
|
||||||
# You can replace this text with custom content, and it will be preserved on regeneration
|
# You can replace this text with custom content, and it will be preserved on regeneration
|
||||||
1;
|
1;
|
||||||
|
|
|
@ -104,9 +104,12 @@ __PACKAGE__->belongs_to(
|
||||||
{ id => "id" },
|
{ id => "id" },
|
||||||
);
|
);
|
||||||
|
|
||||||
if (getHydraPath =~ m/^dbi:Pg/) {
|
sub addSequence {
|
||||||
|
my $hydradbi = getHydraDBPath ;
|
||||||
|
if ($hydradbi =~ m/^dbi:Pg/) {
|
||||||
__PACKAGE__->sequence('builds_id_seq');
|
__PACKAGE__->sequence('builds_id_seq');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sub makeSource {
|
sub makeSource {
|
||||||
my ($name, $query) = @_;
|
my ($name, $query) = @_;
|
||||||
|
@ -123,6 +126,8 @@ sub makeQueries {
|
||||||
makeSource('LatestSucceeded' . $name, "select * from (select project, jobset, job, system, max(id) as id from Builds natural join BuildResultInfo where finished = 1 and buildStatus = 0 $constraint group by project, jobset, job, system) as a natural join Builds");
|
makeSource('LatestSucceeded' . $name, "select * from (select project, jobset, job, system, max(id) as id from Builds natural join BuildResultInfo where finished = 1 and buildStatus = 0 $constraint group by project, jobset, job, system) as a natural join Builds");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addSequence;
|
||||||
|
|
||||||
makeQueries('', "");
|
makeQueries('', "");
|
||||||
makeQueries('ForProject', "and project = ?");
|
makeQueries('ForProject', "and project = ?");
|
||||||
makeQueries('ForJobset', "and project = ? and jobset = ?");
|
makeQueries('ForJobset', "and project = ? and jobset = ?");
|
||||||
|
|
Loading…
Reference in a new issue