0

I have this portion of XML Liquibase script, to creates some columns in a table:

        <column name="send_time" type="timestamp">
            <constraints nullable="false"/>
        </column>
        <column name="delivery_time" type="timestamp">
            <constraints nullable="false"/>
        </column>
        <column name="read_time" type="timestamp">
            <constraints nullable="false"/>
        </column>
        <column name="payload" type="json">
            <constraints nullable="true"/>
        </column>
        <column name="created_date" type="timestamp">
            <constraints nullable="false"/>
        </column>
        <column name="created_by" type="varchar(50)">
            <constraints nullable="false"/>
        </column>
        <column name="last_modified_date" type="timestamp"/>
        <column name="last_modified_by" type="varchar(50)"/>
        <column name="deleted_date" type="timestamp"/>
        <column name="deleted_by" type="varchar(50)"/>

Could anyone explain why the result is like in the attached image? enter image description here

In other words, this set to field 'send_time', the Default/Expression.

Why this?

Andrea Bevilacqua
  • 1,197
  • 3
  • 15
  • 27
  • I don't want any "Default/Expression" for the field "send_time". I have not indicated in the XML script. I don't understand why the script does not set the "Default/Expression" to '0000-00-00 00:00:00' like others fields. It seems that set the "CURRENT_TIMESTAMP..." to the first encountered TIMESTAMP column data type. – Andrea Bevilacqua Oct 25 '18 at 14:18
  • 1
    Try to run liquibase with `updateSQL` instead of just `update`. Then you get the SQLs that liquibase runs on your server. If there is no "Default/Expression" for the "send_time" then there must be something else that creates this... – Jens Oct 25 '18 at 14:21
  • 1
    JHipster's initial schema specifically drops the default value https://github.com/jhipster/jhipster-sample-app/blob/6f2989634cf74dcbda1ac07d262c05b6bef2dd3d/src/main/resources/config/liquibase/changelog/00000000000000_initial_schema.xml#L90, you may need to do the same – Jon Ruddell Oct 25 '18 at 17:07

0 Answers0