Liquibase 使用垃圾值更新 mysql 数据库

Liquibase updating mysql db with junk values

我的 Liquibase 更新变更集如下:

<changeSet author="liquibase" id="6226">
    <update tableName="master">
    <column name="insighttype" valueNumeric="0"/>
    <where>id=1</where>
    </update>
</changeSet>

虽然 运行 liquibase 命令,但在日志中我看到:

UPDATE db.master SET insighttype = 0 WHERE id=7

但是当我回去检查数据库时:

+----+-----------------+-------------+
| id | insightname     | insighttype |
+----+-----------------+-------------+
|  1 | action_items    |             |
|  2 | sentiments      |             |
|  3 | wordcloud       |             |
|  4 | entity          |            |
|  5 | summary         |             |
|  6 | trade_info      |             |
|  7 | topic_modelling |            |
+----+-----------------+-------------+

为了更新 boolean 列,您应该使用 valueBoolean 属性。

例如

<changeSet author="liquibase" id="6226">
    <update tableName="master">
        <column name="insighttype" valueBoolean="false"/>
        <where>id=1</where>
    </update>
</changeSet>