Revision history for Perl extension DBIx::Class::Schema::Loader
+ - add datetime_undef_if_invalid => 1 for MySQL date data types
+ (RT#64820)
- added column_accessor_map option
- Preserve relationship names when redumping and another FK is added
(RT#62424)
delete $info->{size};
}
}
+ elsif ($info->{data_type} =~ /^(?:date(?:time)?|timestamp)\z/) {
+ $info->{datetime_undef_if_invalid} = 1;
+ }
# Sometimes apparently there's a bug where default_value gets set to ''
# for things that don't actually have or support that default (like ints.)
'fixed(3,3)' => { data_type => 'decimal', size => [3,3] },
# Date and Time Types
- 'date' => { data_type => 'date' },
- 'datetime' => { data_type => 'datetime' },
+ 'date' => { data_type => 'date', datetime_undef_if_invalid => 1 },
+ 'datetime' => { data_type => 'datetime', datetime_undef_if_invalid => 1 },
'timestamp default current_timestamp'
- => { data_type => 'timestamp', default_value => \'current_timestamp' },
+ => { data_type => 'timestamp', default_value => \'current_timestamp', datetime_undef_if_invalid => 1 },
'time' => { data_type => 'time' },
'year' => { data_type => 'year' },
'year(4)' => { data_type => 'year' },