From: ivan Date: Wed, 19 Mar 2003 05:39:18 +0000 (+0000) Subject: Pg reverse-engineering fix: varchar with no limit X-Git-Tag: DBIx_DBSchema_0_22~3 X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=b71eded37e48f4c20d31709b33c765de4354e882;p=DBIx-DBSchema.git Pg reverse-engineering fix: varchar with no limit --- diff --git a/Changes b/Changes index 83dd3ef..c61fefc 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,8 @@ Revision history for Perl extension DBIx::DBSchema. +0.22 unreleased + - Pg reverse-engineering fix: varchar with no limit + 0.21 Thu Sep 19 05:04:18 PDT 2002 - Pg reverse-engineering fix: now sets default diff --git a/DBSchema/DBD/Pg.pm b/DBSchema/DBD/Pg.pm index 20bd721..33d6665 100644 --- a/DBSchema/DBD/Pg.pm +++ b/DBSchema/DBD/Pg.pm @@ -4,7 +4,7 @@ use strict; use vars qw($VERSION @ISA %typemap); use DBIx::DBSchema::DBD; -$VERSION = '0.05'; +$VERSION = '0.06'; @ISA = qw(DBIx::DBSchema::DBD); %typemap = ( @@ -57,7 +57,8 @@ END }; my $len = ''; - if ( $_->{attlen} == -1 && $_->{typname} ne 'text' ) { + if ( $_->{attlen} == -1 && $_->{atttypmod} != -1 + && $_->{typname} ne 'text' ) { $len = $_->{atttypmod} - 4; if ( $_->{typname} eq 'numeric' ) { $len = ($len >> 16). ','. ($len & 0xffff);