liquibase使用弹簧靴回滚

问题描述

我有一个Spring Boot应用程序(v2.3.3),其中包含Liquidbase工具来创建我的表并对其进行初始化。 当我启动spring boos时,它工作正常,创建表并使用sql脚本和Liquidbase配置插入数据,如下所示:

application.yml:

spring:
  liquibase:
    change-log: classpath:db/db.master.xml

src / main / resources / db:db.master.xml

<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd">
    <includeAll path="scripts/" relativeToChangelogFile="true"/>`enter code here`

</databaseChangeLog>

src / main / resources / db / script /

  • 001.createTableAudit.sql
  • 002.insertDataTableAudit.sql

假设我要回滚002.insertDataTableAudit.sql,是否可以回滚insertDataTableAudit 当我启动Spring Boot应用程序时?

我知道可以通过maven来完成:mvn liquibase:rollback,但是使用Spring Boot是否可以实现相同的目的?

预先感谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)