Quote datetime types for upgrade/downgrade scripts
Eugen Konkov [Tue, 10 Jul 2018 06:51:32 +0000 (09:51 +0300)]
lib/SQL/Translator/Producer/PostgreSQL.pm

index 4838089..8f6c663 100644 (file)
@@ -785,7 +785,7 @@ sub alter_field
     # ALTER TABLE users ALTER COLUMN column SET DEFAULT ThisIsUnescaped;
     if(ref $default_value eq "SCALAR" ) {
         $default_value = $$default_value;
-    } elsif( defined $default_value && $to_dt =~ /^(character|text)/xsmi ) {
+    } elsif( defined $default_value && $to_dt =~ /^(character|text|timestamp|date)/xsmi ) {
         $default_value = __PACKAGE__->_quote_string($default_value);
     }