X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=site_perl%2Fdbdef_column.pm;h=dc07305b8aae48e458239d6598f1878d000d1d2a;hb=505de354b53f046210d86066b87752b56b2aff40;hp=023b57d1f89dd2303e643699bd87985e600d0ff2;hpb=b19432b9dc158edd9a72d145b85a8212d342dffe;p=freeside.git diff --git a/site_perl/dbdef_column.pm b/site_perl/dbdef_column.pm index 023b57d1f..dc07305b8 100644 --- a/site_perl/dbdef_column.pm +++ b/site_perl/dbdef_column.pm @@ -134,16 +134,21 @@ sub length { Returns an SQL column definition. -If passed a DBI $datasrc specifying L, will use MySQL-specific -syntax. Non-standard syntax for other engines (if applicable) may also be -supported in the future. +If passed a DBI $datasrc specifying L or L, will use +engine-specific syntax. =cut sub line { my($self,$datasrc)=@_; my($null)=$self->null; - $null ||= "NOT NULL" if $datasrc =~ /mysql/; #yucky mysql hack + if ( $datasrc =~ /mysql/ ) { #yucky mysql hack + $null ||= "NOT NULL" + } + if ( $datasrc =~ /Pg/ ) { #yucky Pg hack + $null ||= "NOT NULL"; + $null =~ s/^NULL$//; + } join(' ', $self->name, $self->type. ( $self->length ? '('.$self->length.')' : '' ), @@ -159,6 +164,10 @@ sub line { L, L, L +=head1 VERSION + +$Id: dbdef_column.pm,v 1.3 1998-10-13 13:04:17 ivan Exp $ + =head1 HISTORY class for dealing with column definitions @@ -169,6 +178,14 @@ now methods can be used to get or set data ivan@sisd.com 98-may-11 mySQL-specific hack for null (what should be default?) ivan@sisd.com 98-jun-2 +$Log: dbdef_column.pm,v $ +Revision 1.3 1998-10-13 13:04:17 ivan +fixed doc to indicate Pg specific syntax too + +Revision 1.2 1998/10/12 23:40:28 ivan +added Pg-specific behaviour in sub line + + =cut 1;