问题描述
我具有以下配置:
├── src
│ ├── main
...
│ │ └── resources
│ │ ├── db
│ │ │ └── changelog
│ │ │ ├── changes
│ │ │ │ ├── db.changelog-1.0.insert-data.xml
│ │ │ │ └── db.changelog-1.0.xml
│ │ │ ├── db.changelog-master.xml
│ │ ├── env-profiles
│ │ │ └── application.yml
...
│ └── test
...
│ └── resources
│ ├── db
│ │ └── changelog
│ │ ├── changes
│ │ │ ├── db.changelog-1.0.insert-data.xml
│ │ │ └── db.changelog-1.0.xml
│ │ ├── db.changelog-master.xml
│ └── env-profiles
│ └── application.yml
application.yml
和main
目录中的test
都包含相同的Liquibase设置:
spring:
...
liquibase:
enabled: true
change-log: classpath:db.changelog-master.xml
这是db.changelog-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-3.8.xsd">
<include file="db.changelog-1.0.xml" />
<include file="db.changelog-1.0.insert-data.xml" />
</databaseChangeLog>
main
和test
目录中的变更日志文件之间的区别在于测试的种子数据。
当我使用@SpringBootTest
运行集成测试时,可以看到来自test
的application.yml已被拾取,但是Liquibase从main
目录而不是从test
执行更改集test
。
在当前设置中运行测试时,如何配置Spring Boot或Liquibase以使其从$emit
目录中选择更改集?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)