Subject: | MySQL Producer does not cope with NOW() default value |
The MySQL Producer fails to cope with NOW() as a default value. Other
producers cope with this, so I've stolen their logic in the small patch
attached.
Thanks,
Tom Hukins
Subject: | mysql_now.patch |
--- lib/SQL/Translator/Producer/MySQL.pm.was 2007-08-14 16:34:19.000000000 +0100
+++ lib/SQL/Translator/Producer/MySQL.pm 2007-08-14 16:39:04.000000000 +0100
@@ -361,6 +361,8 @@
if ( defined $default ) {
if ( uc $default eq 'NULL') {
$field_def .= ' DEFAULT NULL';
+ } elsif (uc $default eq 'NOW()') {
+ $field_def .= ' DEFAULT NOW()';
} else {
$field_def .= " DEFAULT '$default'";
}