From: Eugen Konkov Date: Tue, 10 Jul 2018 06:51:32 +0000 (+0300) Subject: Quote datetime types for upgrade/downgrade scripts X-Git-Tag: v1.61~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3f73e2f3d34a4f667c6706a12b7c9b44e54cb7cb;p=dbsrgits%2FSQL-Translator.git Quote datetime types for upgrade/downgrade scripts --- diff --git a/lib/SQL/Translator/Producer/PostgreSQL.pm b/lib/SQL/Translator/Producer/PostgreSQL.pm index 4838089..8f6c663 100644 --- a/lib/SQL/Translator/Producer/PostgreSQL.pm +++ b/lib/SQL/Translator/Producer/PostgreSQL.pm @@ -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); }