X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSchema%2FLoader%2FDBI%2Fmysql.pm;h=2a711fa5eac3b18b0beaf71f53ba7c342f91f692;hb=3b71e53bd47bd29213e8fe12b3f9a2d1a229b587;hp=d7a331a57a4c2a054066e6a538ead4443f775e7c;hpb=6b1d4f76b756e4b4119153a1f1e8a7bd59ad4e87;p=dbsrgits%2FDBIx-Class-Schema-Loader.git diff --git a/lib/DBIx/Class/Schema/Loader/DBI/mysql.pm b/lib/DBIx/Class/Schema/Loader/DBI/mysql.pm index d7a331a..2a711fa 100644 --- a/lib/DBIx/Class/Schema/Loader/DBI/mysql.pm +++ b/lib/DBIx/Class/Schema/Loader/DBI/mysql.pm @@ -4,9 +4,9 @@ use strict; use warnings; use base 'DBIx::Class::Schema::Loader::DBI'; use Carp::Clan qw/^DBIx::Class/; -use Class::C3; +use mro 'c3'; -our $VERSION = '0.07001'; +our $VERSION = '0.07007'; =head1 NAME @@ -176,6 +176,11 @@ EOF delete $info->{size}; } } + elsif ($info->{data_type} =~ /^(?:date(?:time)?|timestamp)\z/) { + if (not (defined $self->datetime_undef_if_invalid && $self->datetime_undef_if_invalid == 0)) { + $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.) @@ -218,6 +223,15 @@ sub _extra_column_info { return \%extra_info; } +sub _dbh_column_info { + my $self = shift; + + local $SIG{__WARN__} = sub { warn @_ + unless $_[0] =~ /^column_info: unrecognized column type/ }; + + $self->next::method(@_); +} + =head1 SEE ALSO L, L,