Firebird: don't rewrite reals as floats
[dbsrgits/DBIx-Class-Schema-Loader.git] / lib / DBIx / Class / Schema / Loader / DBI / InterBase.pm
index 6cfb7ec..19f332f 100644 (file)
@@ -50,8 +50,6 @@ sub _setup {
 
     $self->next::method(@_);
 
-    $self->schema->storage->sql_maker->name_sep('.');
-
     if (not defined $self->preserve_case) {
         warn <<'EOF';
 
@@ -65,6 +63,8 @@ EOF
         $self->preserve_case(1);
     }
 
+    $self->schema->storage->sql_maker->name_sep('.');
+
     if ($self->preserve_case) {
         $self->schema->storage->sql_maker->quote_char('"');
     }
@@ -257,9 +257,6 @@ EOF
         elsif ($info->{data_type} eq 'character') {
             $info->{data_type} = 'char';
         }
-        elsif ($info->{data_type} eq 'real') {
-            $info->{data_type} = 'float';
-        }
         elsif ($info->{data_type} eq 'int64' || $info->{data_type} eq '-9581') {
             # the constant is just in case, the query should pick up the type
             $info->{data_type} = 'bigint';
@@ -293,6 +290,9 @@ EOF
                 $info->{default_value} = $def =~ /^\d/ ? $def : \$def;
             }
         }
+
+        ${ $info->{default_value} } = 'current_timestamp'
+            if ref $info->{default_value} && ${ $info->{default_value} } eq 'CURRENT_TIMESTAMP';
     }
 
     return $result;