use Carp::Clan qw/^DBIx::Class/;
use Class::C3;
-our $VERSION = '0.04999_12';
+our $VERSION = '0.05002';
=head1 NAME
if(!exists($self->{_cache}->{_mysql_keys}->{$table})) {
my %keydata;
my $dbh = $self->schema->storage->dbh;
- my $sth = $dbh->prepare("SHOW INDEX FROM `$table`");
+ my $sth = $dbh->prepare('SHOW INDEX FROM '.$self->_table_as_sql($table));
$sth->execute;
while(my $row = $sth->fetchrow_hashref) {
next if $row->{Non_unique};
if ($info->{mysql_values}) {
$extra_info{extra}{list} = $info->{mysql_values};
}
-# XXX we need to distinguish between DEFAULT CURRENT_TIMESTAMP and DEFAULT 'foo'
-# somehow, but DBI column_info doesn't preserve quotes.
- if ($info->{COLUMN_DEF} =~ /^CURRENT_TIMESTAMP\z/i) {
+ if ( $info->{COLUMN_DEF} =~ /^CURRENT_TIMESTAMP\z/i
+ && $info->{mysql_type_name} =~ /^TIMESTAMP\z/i) {
+
$extra_info{default_value} = \'CURRENT_TIMESTAMP';
}
=head1 AUTHOR
-See L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
+See L<DBIx::Class::Schema::Loader/AUTHOR> and L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
=head1 LICENSE