X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSchema%2FLoader%2FDBI%2FComponent%2FQuotedDefault.pm;h=5dd588482da9238d392500fb7b0a1d946c03a466;hb=6b1d4f76b756e4b4119153a1f1e8a7bd59ad4e87;hp=fed806d9f770369ed5c7d57b23ec650347b55f40;hpb=dc767cd32c6728d4d9c3504acd259c0b2f19da2b;p=dbsrgits%2FDBIx-Class-Schema-Loader.git diff --git a/lib/DBIx/Class/Schema/Loader/DBI/Component/QuotedDefault.pm b/lib/DBIx/Class/Schema/Loader/DBI/Component/QuotedDefault.pm index fed806d..5dd5884 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/Component/QuotedDefault.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/Component/QuotedDefault.pm @@ -4,7 +4,7 @@ use strict; use warnings; use Class::C3; -our $VERSION = '0.05001'; +our $VERSION = '0.07001'; =head1 NAME @@ -35,7 +35,8 @@ sub _columns_info_for { $info->{default_value} = $1; } else { - $info->{default_value} = $def =~ /^\d/ ? $def : \$def; + # Some DBs (eg. Pg) put brackets around negative number defaults + $info->{default_value} = $def =~ /^\(?(-?\d.*?)\)?$/ ? $1 : \$def; } } }