X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSchema%2FLoader%2FDBI%2FMSSQL.pm;h=ca553795f2f9a9343b251638c509df0e5f5f4feb;hb=1fa1884903b09903ce89a3814e41bac9e91eea9d;hp=82f7af70f7190a346e63f70d64b6e67054b7f040;hpb=be80bba7041914683ec2afd00aaa54d6459cbaee;p=dbsrgits%2FDBIx-Class-Schema-Loader.git diff --git a/lib/DBIx/Class/Schema/Loader/DBI/MSSQL.pm b/lib/DBIx/Class/Schema/Loader/DBI/MSSQL.pm index 82f7af7..ca55379 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/MSSQL.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/MSSQL.pm @@ -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 =head1 AUTHOR -See L. +See L and L. =head1 LICENSE