Quantcast
Channel: Liquibase Forums
Viewing all articles
Browse latest Browse all 2993

defaultValueComputed not working correctly with Postgres

$
0
0
The following change:
  1. <addColumn tableName="foo">
  2.     <column name="expired" type="timestamp" defaultValueComputed="current_timestamp + '60 days'::interval"/>
  3. </addColumn>
is translated to the following incorrect SQL:
  1. ALTER TABLE public.foo ADD expired TIMESTAMP WITHOUT TIME ZONE DEFAULT NOW();
apparently Liquibase sees "current_timestamp", knows that this is the same as now() and then ignores the rest of the expression.

It works correctly when using now() + '60 days'::interval (replacing current_timestamp with now())

Liquibase  3.5.4


Viewing all articles
Browse latest Browse all 2993

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>