fix syntax error
[dbsrgits/DBIx-Class-Schema-Loader.git] / lib / DBIx / Class / Schema / Loader / DBI / Pg.pm
index 1910923..52c7489 100644 (file)
@@ -150,6 +150,9 @@ sub _columns_info_for {
             if (lc($data_type) eq 'timestamp without time zone') {
                 $info->{data_type} = 'timestamp';
             }
+            elsif (lc($data_type) eq 'time without time zone') {
+                $info->{data_type} = 'time';
+            }
 
             my ($precision) = $self->schema->storage->dbh
                 ->selectrow_array(<<EOF, {}, $table, $col);
@@ -208,7 +211,10 @@ EOF
         elsif (lc($data_type) eq 'character varying') {
             $info->{data_type} = 'varchar';
 
-            $info->{data_type} = 'text' if not $info->{size};
+            if (not $info->{size}) {
+                $info->{data_type}           = 'text';
+                $info->{original}{data_type} = 'varchar';
+            }
         }
         elsif (lc($data_type) eq 'character') {
             $info->{data_type} = 'char';
@@ -222,7 +228,7 @@ EOF
         }
 
 # alias now() to current_timestamp for deploying to other DBs
-        if (eval { lc ${ $info->{default_value} }||'' eq 'now()' }) {
+        if ((eval { lc ${ $info->{default_value} } }||'') eq 'now()') {
             # do not use a ref to a constant, that breaks Data::Dump output
             ${$info->{default_value}} = 'current_timestamp';
         }