【问题标题】:Liquibase modifysql tag with sql tag in same changeset not workingLiquibase modifysql 标记与同一变更集中的 sql 标记不起作用
【发布时间】:2018-10-21 11:44:49
【问题描述】:

liquibase: cvc-complex-type.2.4.a: 发现无效内容开始 带有元素'sql'。之一 '{"http://www.liquibase.org/xml/ns/dbchangelog":modifySql}' 是 预计。

收到此变更集的错误

<changeSet id="18.7.0.1-1-userTable" author="so">
    <preConditions onFail="MARK_RAN">
        <not>
            <tableExists tableName="USER_CURRENT"/>
        </not>
    </preConditions>
    <createTable tableName="USER_CURRENT">
        <column name="name" type="VARCHAR(20)">
            <constraints primaryKey="true" nullable="false" primaryKeyName="name"/>
        </column>

    </createTable>
    <modifySql dbms="mysql">
        <append value=" PARTITION BY KEY() PARTITIONS 16"/>
    </modifySql>
    <modifySql dbms="oracle">
        <append value=" ORGANIZATION INDEX PARTITION BY HASH (name) PARTITIONS 16 PARALLEL 4"/>
    </modifySql>
    <sql>GRANT SELECT ON USER_CURRENT TO 'reportsUser'@'%';</sql>       
</changeSet>

【问题讨论】:

标签: liquibase


【解决方案1】:

原因是changeSet 内的modifySql 标签后面不能有sql。 您必须要么将sql 放在modifySql 之前,要么将它们分成不同的changeSets

它来自dbchangelog-3.1.xsd

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-01-13
    • 1970-01-01
    • 1970-01-01
    • 2020-03-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-15
    相关资源
    最近更新 更多