在Liqubiase中,如何更改列的“On UPDATE”值?

时间:2021-09-20 07:20:19

I’m using Liquibase 3.3 with MySql 5.5.37. I had a column with

我正在使用Liquibase 3.3和MySql 5.5.37。我有一个专栏

+--------------+-------------+------+-----+---------+-----------------------------+
| Field        | Type        | Null | Key | Default | Extra                       |
+--------------+-------------+------+-----+---------+-----------------------------+
| CLOSED_DATE  | timestamp   | NO   |     | NULL    | on update CURRENT_TIMESTAMP |

What is the right way in Liquibase to remove the “on update CURRENT_TIMESTAMP” clause and just make it NULL? I tried

在Liquibase中删除“on update CURRENT_TIMESTAMP”子句并使其为NULL的正确方法是什么?我试过了

    <dropDefaultValue columnDataType="TIMESTAMP"
        columnName="CLOSED_DATE"
        tableName="sb_group"/>

but that didn’t do anything.

但那没有做任何事情。

1 个解决方案

#1


0  

That sounds very platform-specific, so you probably need to use a custom <sql> tag in your changes:

这听起来非常特定于平台,因此您可能需要在更改中使用自定义 标记:

<sql dbms="mysql">
  custom SQL goes here
</sql>

But you'll have to replace "custom SQL goes here" with the appropriate MySQL syntax to remove the "on update" clause.

但是你必须用适当的MySQL语法替换“自定义SQL在这里”以删除“on update”子句。

#1


0  

That sounds very platform-specific, so you probably need to use a custom <sql> tag in your changes:

这听起来非常特定于平台,因此您可能需要在更改中使用自定义 标记:

<sql dbms="mysql">
  custom SQL goes here
</sql>

But you'll have to replace "custom SQL goes here" with the appropriate MySQL syntax to remove the "on update" clause.

但是你必须用适当的MySQL语法替换“自定义SQL在这里”以删除“on update”子句。