use strict;
use warnings;
use base 'DBIx::Class::Schema::Loader::DBI';
+use Carp::Clan qw/^DBIx::Class/;
use Class::C3;
+our $VERSION = '0.04999_10';
+
=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;
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;
}
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 ]);
return \@uniqs;
}
+sub _extra_column_info {
+ my ($self, $info) = @_;
+ my %extra_info;
+
+ if ($info->{COLUMN_DEF} && $info->{COLUMN_DEF} =~ /\bnextval\(/i) {
+ $extra_info{is_auto_increment} = 1;
+ }
+
+ return \%extra_info;
+}
+
=head1 SEE ALSO
L<DBIx::Class::Schema::Loader>, L<DBIx::Class::Schema::Loader::Base>,
L<DBIx::Class::Schema::Loader::DBI>
+=head1 AUTHOR
+
+See L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
+
+=head1 LICENSE
+
+This library is free software; you can redistribute it and/or modify it under
+the same terms as Perl itself.
+
=cut
1;