my ($self, $column, $info, @rest) = @_;
$self->next::method($column, $info, @rest);
return unless defined($info->{data_type});
- my $type = lc($info->{data_type});
- $type = 'datetime' if ($type =~ /^timestamp/);
- $type = 'datetime' if $info->{inflate_datetime};
- $type = 'date' if $info->{inflate_date};
+
+ my $type;
+
+ for (qw/date datetime/) {
+ my $key = "inflate_${_}";
+
+ next unless exists $info->{$key};
+ return unless $info->{$key};
+
+ $type = $_;
+ last;
+ }
+
+ unless ($type) {
+ $type = lc($info->{data_type});
+ $type = 'datetime' if ($type =~ /^timestamp/);
+ }
+
my $timezone;
if ( exists $info->{extra} and exists $info->{extra}{timezone} and defined $info->{extra}{timezone} ) {
$timezone = $info->{extra}{timezone};
my $undef_if_invalid = $info->{datetime_undef_if_invalid};
- my $do_inflate = 1;
- $do_inflate = 0 if exists $info->{inflate_datetime} and $info->{inflate_datetime} == 0;
- $do_inflate = 0 if exists $info->{inflate_date} and $info->{inflate_date} == 0;
-
- if ($do_inflate and ($type eq 'datetime' || $type eq 'date')) {
+ if ($type eq 'datetime' || $type eq 'date') {
my ($parse, $format) = ("parse_${type}", "format_${type}");
$self->inflate_column(
$column =>