我希望仅在表存在时使用 Liquibase 删除 MySQL 中的表。
我不知道如何检查 Liquibase 中是否存在表。
最佳答案
你应该使用
<changeSet author="liquibase-docs" id="dropTable-example">
<preConditions onFail="MARK_RAN"><tableExists schemaName="schemaName" tableName="tableName"/></preConditions>
<dropTable cascadeConstraints="true"
catalogName="cat"
schemaName="public"
tableName="person"/>
</changeSet>
此外,您可以查看此链接了解更多 <preConditions>
选项:
http://www.liquibase.org/documentation/preconditions.html
关于java - 使用 Liquibase 删除 MySQL 表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44083766/