Fixed copyrights.
[dbsrgits/SQL-Translator.git] / lib / SQL / Translator / Schema / Field.pm
index a298677..2e76f89 100644 (file)
@@ -1,9 +1,9 @@
 package SQL::Translator::Schema::Field;
 
 # ----------------------------------------------------------------------
-# $Id: Field.pm,v 1.10 2003-06-18 23:14:00 kycl4rk Exp $
+# $Id: Field.pm,v 1.13 2004-02-09 22:15:15 kycl4rk Exp $
 # ----------------------------------------------------------------------
-# Copyright (C) 2003 Ken Y. Clark <kclark@cpan.org>
+# Copyright (C) 2002-4 SQLFairy Authors
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License as
@@ -50,7 +50,7 @@ use SQL::Translator::Utils 'parse_list_arg';
 use base 'Class::Base';
 use vars qw($VERSION $TABLE_COUNT $VIEW_COUNT);
 
-$VERSION = (qw$Revision: 1.10 $)[-1];
+$VERSION = sprintf "%d.%02d", q$Revision: 1.13 $ =~ /(\d+)\.(\d+)/;
 
 # ----------------------------------------------------------------------
 sub init {
@@ -309,6 +309,14 @@ foreign keys; checks) are represented as table constraints.
         $self->{'is_nullable'} = $arg ? 1 : 0;
     }
 
+    if ( 
+        defined $self->{'is_nullable'} && 
+        $self->{'is_nullable'} == 1    &&
+        $self->is_primary_key
+    ) {
+        $self->{'is_nullable'} = 0;
+    }
+
     return defined $self->{'is_nullable'} ? $self->{'is_nullable'} : 1;
 }
 
@@ -528,6 +536,6 @@ sub DESTROY {
 
 =head1 AUTHOR
 
-Ken Y. Clark E<lt>kclark@cpan.orgE<gt>
+Ken Y. Clark E<lt>kclark@cpan.orgE<gt>.
 
 =cut