Fix Pg date/time types with zero fractional second digits
[dbsrgits/DBIx-Class-Schema-Loader.git] / lib / DBIx / Class / Schema / Loader / DBI / Pg.pm
index 403161a..a70106a 100644 (file)
@@ -227,7 +227,7 @@ WHERE table_name = ? and column_name = ?
 EOF
 
             if ($data_type =~ /^time\b/i) {
-                if ((not $precision) || $precision !~ /^\d/) {
+                if ((not defined $precision) || $precision !~ /^\d/) {
                     delete $info->{size};
                 }
                 else {
@@ -245,7 +245,7 @@ EOF
                     }
                 }
             }
-            elsif ((not $precision) || $precision !~ /^\d/ || $precision == 6) {
+            elsif ((not defined $precision) || $precision !~ /^\d/ || $precision == 6) {
                 delete $info->{size};
             }
             else {