X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSchema%2FLoader%2FDBI%2FPg.pm;h=ea50937dceb2a15c2b4d5725bbb6bae3162ad081;hb=28b4691da7f640a8df40780bdac200b513cf132d;hp=08ddca82988b71149cbc9e161d56e5f9aae73aa0;hpb=5223f24a6662ce33f7b60d2a3f6f83e83f5373cc;p=dbsrgits%2FDBIx-Class-Schema-Loader.git diff --git a/lib/DBIx/Class/Schema/Loader/DBI/Pg.pm b/lib/DBIx/Class/Schema/Loader/DBI/Pg.pm index 08ddca8..ea50937 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/Pg.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/Pg.pm @@ -3,20 +3,22 @@ package DBIx::Class::Schema::Loader::DBI::Pg; use strict; use warnings; use base 'DBIx::Class::Schema::Loader::DBI'; +use Carp::Clan qw/^DBIx::Class/; use Class::C3; +our $VERSION = '0.04001'; + =head1 NAME -DBIx::Class::Schema::Loader::DBI::Pg - DBIx::Class::Schema::Loader::DBI Postgres Implementation. +DBIx::Class::Schema::Loader::DBI::Pg - DBIx::Class::Schema::Loader::DBI +PostgreSQL Implementation. =head1 SYNOPSIS package My::Schema; use base qw/DBIx::Class::Schema::Loader/; - __PACKAGE__->loader_options( - relationships => 1, - ); + __PACKAGE__->loader_options( debug => 1 ); 1; @@ -36,6 +38,10 @@ sub _setup { sub _table_uniq_info { my ($self, $table) = @_; + # Use the default support if available + return $self->next::method($table) + if $DBD::Pg::VERSION >= 1.50; + my @uniqs; my $dbh = $self->schema->storage->dbh; @@ -79,7 +85,7 @@ sub _table_uniq_info { } if(!@col_names) { - warn "Failed to parse unique constraint $indexname on $table"; + warn "Failed to parse UNIQUE constraint $indexname on $table"; } else { push(@uniqs, [ $indexname => \@col_names ]);