From: Rafael Kitover Date: Fri, 22 Jan 2010 05:42:50 +0000 (+0000) Subject: make default datetime type precision checking for Pg more precise X-Git-Tag: 0.05000~14 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=55db1c44653bc7c3bb9ba879edf9dc3943a6c4d0;p=dbsrgits%2FDBIx-Class-Schema-Loader.git make default datetime type precision checking for Pg more precise --- diff --git a/lib/DBIx/Class/Schema/Loader/DBI/Pg.pm b/lib/DBIx/Class/Schema/Loader/DBI/Pg.pm index a1042b1..1a1efdc 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/Pg.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/Pg.pm @@ -147,7 +147,8 @@ FROM information_schema.columns WHERE table_name = ? and column_name = ? EOF - if ((not $precision) || $precision !~ /^\d/ || $precision == 6) { + if ((not $precision) || $precision !~ /^\d/ + || ($data_type !~ /^time\b/i && $precision == 6)) { # only interval/timestamp default to precision == 6 delete $result->{$col}{size}; } else {