new dev release
[dbsrgits/DBIx-Class-Schema-Loader.git] / lib / DBIx / Class / Schema / Loader / DBI / MSSQL.pm
index 82f7af7..ca55379 100644 (file)
@@ -9,7 +9,7 @@ use base qw/
 use Carp::Clan qw/^DBIx::Class/;
 use Class::C3;
 
-our $VERSION = '0.04999_10';
+our $VERSION = '0.04999_13';
 
 =head1 NAME
 
@@ -143,9 +143,11 @@ sub _extra_column_info {
         # strip parens
         $default =~ s/^\( (.*) \)\z/$1/x;
 
-        # literal or function?
+        # Literal strings are in ''s, numbers are in ()s (in some versions of
+        # MSSQL, in others they are unquoted) everything else is a function.
         $extra_info{default_value} =
-            $default =~ /^' (.*) '\z/x ? $1 : \$default;
+            $default =~ /^['(] (.*) [)']\z/x ? $1 :
+                $default =~ /^\d/ ? $default : \$default;
     }
 
     return \%extra_info;
@@ -158,7 +160,7 @@ L<DBIx::Class::Schema::Loader::DBI>
 
 =head1 AUTHOR
 
-See L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
+See L<DBIx::Class::Schema::Loader/AUTHOR> and L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
 
 =head1 LICENSE