Skip Menu |
 

This queue is for tickets about the SQL-Translator CPAN distribution.

Report information
The Basics
Id: 39428
Status: rejected
Priority: 0/
Queue: SQL-Translator

People
Owner: Nobody in particular
Requestors: titus.byronicus [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.09001
Fixed in: (no value)



Subject: Mysql provider quotes CURRENT_TIMESTAMP default value
Download (untitled) / with headers
text/plain 889b
I have this column in almost all of my DBIx::Class schema files: "modified_ts", { data_type => "TIMESTAMP", default_value => "CURRENT_TIMESTAMP", is_nullable => 0, size => 14, }, And when I use $schema->create_ddl_dir or $schema->deploy it generates the wrong sql for the default value for those timestamp columns. The sql (and error) it generates is: DBIx::Class::Schema::connect(): DBI Exception: DBD::mysql::db do failed: Invalid default value for 'modified_ts' [for Statement "CREATE TABLE `result_types` ( `id` integer(10) NOT NULL, `type` VARCHAR(45) NOT NULL DEFAULT '', `modified_ts` TIMESTAMP(14) NOT NULL DEFAULT 'CURRENT_TIMESTAMP', PRIMARY KEY (`id`) ) ENGINE=InnoDB"] at /u/youngb/work/qa.icebox/icebox/Schema/t/lib/IceboxSchemaTest.pm line 131 The CURRENT_TIMESTAMP default value should not be quoted for TIMESTAMP columns. Thanks! Byron
Download (untitled) / with headers
text/plain 109b
The patch in http://rt.cpan.org/Ticket/Display.html?id=39713 provides a superior, generic solution. -- rjbs


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.