add ->{original}{default_value} when rewriting to current_timestamp
[dbsrgits/DBIx-Class-Schema-Loader.git] / lib / DBIx / Class / Schema / Loader / DBI / MSSQL.pm
index 1b9ce7d..5cfeb26 100644 (file)
@@ -276,8 +276,11 @@ wHERE table_name = @{[ $dbh->quote($table) ]} AND column_name = @{[ $dbh->quote(
                 $default =~ /^['(] (.*) [)']\z/x ? $1 :
                     $default =~ /^\d/ ? $default : \$default;
 
-            if (eval { lc ${ $info->{default_value} } }||'' eq 'getdate()') {
+            if ((eval { lc ${ $info->{default_value} } }||'') eq 'getdate()') {
                 ${ $info->{default_value} } = 'current_timestamp';
+
+                my $getdate = 'getdate()';
+                $info->{original}{default_value} = \$getdate;
             }
         }
     }