Liquibase:以SQL格式设置dbms字段

时间:2015-07-16 18:56:19

标签: mysql database h2 liquibase

来自http://www.liquibase.org/documentation/changes/sql.html

<changeSet author="liquibase-docs" id="sql-example">
    <sql dbms="h2, oracle"
            endDelimiter="\nGO"
            splitStatements="true"
            stripComments="true">insert into person (name) values ('Bob')
        <comment>What about Bob?</comment>
    </sql>
</changeSet>

如何在SQL format的Liquibase迁移文件中编写dbms=h2部分?

我有这样的代码:

<sql dbms="h2"
        endDelimiter="\nGO"
        splitStatements="true"
        stripComments="true">insert into person (name) values ('Bob')
    <comment>What about Bob?</comment>
</sql>

<sql dbms="mysql"
        endDelimiter="\nGO"
        splitStatements="true"
        stripComments="true">insert into person (name) values ('Bob')
    <comment>What about Bob?</comment>
</sql>

1 个答案:

答案 0 :(得分:2)

以下是Liquibase SQL格式:--changeset liquibase-docs:1 dbms:h2

来源:http://www.liquibase.org/documentation/sql_format.html