Added sequences for auto increment primary key columns (for PostgreSQL)

This commit is contained in:
Rob Vermaas 2009-05-07 13:30:55 +00:00
parent cd80952a45
commit f2a1fb3937
2 changed files with 6 additions and 0 deletions

View file

@ -35,6 +35,9 @@ __PACKAGE__->set_primary_key("id");
__PACKAGE__->belongs_to("build", "Hydra::Schema::Builds", { id => "build" }); __PACKAGE__->belongs_to("build", "Hydra::Schema::Builds", { id => "build" });
__PACKAGE__->belongs_to("dependency", "Hydra::Schema::Builds", { id => "dependency" }); __PACKAGE__->belongs_to("dependency", "Hydra::Schema::Builds", { id => "dependency" });
if ($ENV{"HYDRA_DBI"} =~ 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

View file

@ -102,6 +102,9 @@ __PACKAGE__->belongs_to(
{ id => "id" }, { id => "id" },
); );
if ($ENV{"HYDRA_DBI"} =~ m/^dbi:Pg/) {
__PACKAGE__->sequence('builds_id_seq');
}
sub makeSource { sub makeSource {
my ($name, $query) = @_; my ($name, $query) = @_;