From: Rafael Kitover Date: Mon, 19 Jul 2010 19:33:30 +0000 (-0400) Subject: fix Postgres sequence detection for qualified sequences X-Git-Tag: 0.07001~8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9f333983b7e706ffb7ea29839dbb3dc5d3012846;p=dbsrgits%2FDBIx-Class-Schema-Loader.git fix Postgres sequence detection for qualified sequences --- diff --git a/Changes b/Changes index 496e3ef..88c750d 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,6 @@ Revision history for Perl extension DBIx::Class::Schema::Loader + - fix Postgres sequence detection for qualified sequences - detect DOS line ends in table/column comments and convert to \n - added use_moose option - always mark pk columns is_nullable=0 diff --git a/lib/DBIx/Class/Schema/Loader/DBI/Pg.pm b/lib/DBIx/Class/Schema/Loader/DBI/Pg.pm index f5eefbb..b218532 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/Pg.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/Pg.pm @@ -226,7 +226,7 @@ EOF } # process SERIAL columns - if (ref($info->{default_value}) eq 'SCALAR' && ${ $info->{default_value} } =~ /\bnextval\(['"](\w+)/i) { + if (ref($info->{default_value}) eq 'SCALAR' && ${ $info->{default_value} } =~ /\bnextval\(['"]([.\w]+)/i) { $info->{is_auto_increment} = 1; $info->{sequence} = $1; delete $info->{default_value};