projects
/
dbsrgits/DBIx-Class-Schema-Loader.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
fix for negative numeric default values
[dbsrgits/DBIx-Class-Schema-Loader.git]
/
lib
/
DBIx
/
Class
/
Schema
/
Loader
/
DBI
/
Component
/
QuotedDefault.pm
diff --git
a/lib/DBIx/Class/Schema/Loader/DBI/Component/QuotedDefault.pm
b/lib/DBIx/Class/Schema/Loader/DBI/Component/QuotedDefault.pm
index
bff0091
..
796fd52
100644
(file)
--- a/
lib/DBIx/Class/Schema/Loader/DBI/Component/QuotedDefault.pm
+++ b/
lib/DBIx/Class/Schema/Loader/DBI/Component/QuotedDefault.pm
@@
-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;
}
}
}