From f2a1fb3937db31b8c71bc4ffa0cc08c7198f1ace Mon Sep 17 00:00:00 2001 From: Rob Vermaas Date: Thu, 7 May 2009 13:30:55 +0000 Subject: [PATCH] Added sequences for auto increment primary key columns (for PostgreSQL) --- src/lib/Hydra/Schema/BuildInputs.pm | 3 +++ src/lib/Hydra/Schema/Builds.pm | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/lib/Hydra/Schema/BuildInputs.pm b/src/lib/Hydra/Schema/BuildInputs.pm index a7668fde..67844582 100644 --- a/src/lib/Hydra/Schema/BuildInputs.pm +++ b/src/lib/Hydra/Schema/BuildInputs.pm @@ -35,6 +35,9 @@ __PACKAGE__->set_primary_key("id"); __PACKAGE__->belongs_to("build", "Hydra::Schema::Builds", { id => "build" }); __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 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:uxfS8+GnU06sbx6nvWzTSQ diff --git a/src/lib/Hydra/Schema/Builds.pm b/src/lib/Hydra/Schema/Builds.pm index 510334a9..ff8f4a5b 100644 --- a/src/lib/Hydra/Schema/Builds.pm +++ b/src/lib/Hydra/Schema/Builds.pm @@ -102,6 +102,9 @@ __PACKAGE__->belongs_to( { id => "id" }, ); +if ($ENV{"HYDRA_DBI"} =~ m/^dbi:Pg/) { + __PACKAGE__->sequence('builds_id_seq'); +} sub makeSource { my ($name, $query) = @_;