diff options
author | cvs2git <cvs2git> | 1998-11-07 10:24:26 +0000 |
---|---|---|
committer | cvs2git <cvs2git> | 1998-11-07 10:24:26 +0000 |
commit | 48e7e549a27a76c357d50dd637e7ad5a29b9d43f (patch) | |
tree | e61ddacc0b1d6248ccfc61346f7f36fbb6723e56 /site_perl/dbdef_column.pm | |
parent | 47806ec845818ba69604e0452e7c7b25d62f0772 (diff) | |
parent | 4c9347994ca4e1aefdb622d9f51ac8687e6a177b (diff) |
This commit was manufactured by cvs2svn to create tag 'freeside_stable'.freeside_stable
Diffstat (limited to 'site_perl/dbdef_column.pm')
-rw-r--r-- | site_perl/dbdef_column.pm | 25 |
1 files changed, 21 insertions, 4 deletions
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<DBD::mysql>, 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<DBD::mysql> or L<DBD::Pg>, 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<FS::dbdef_table>, L<FS::dbdef>, L<DBI> +=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; |