我试图用flyway 5.0.7建立两个不同的数据库,mysql用于开发,h2用于测试。我已经在各自的文件中配置了这两个数据库。
为了
发展
我是说,
src/main/resource/application.properties
spring.datasource.url=jdbc:mysql://localhost:3306/moment
spring.datasource.username=root
spring.datasource.password=root
flyway.locations=db/migration,db/specific/mysql
为了
测试
我是说,
src/test/resource/application.properties
spring.datasource.driver-class-name=org.h2.Driver
spring.datasource.url=jdbc:h2:mem:db;DB_CLOSE_DELAY=-1
spring.datasource.username=sa
spring.datasource.password=sa
flyway.locations=db/migration,db/specific/h2
以下是Flyway迁移文件的文件夹结构
在这种情况下,Flyway无法在
specific
文件夹并在应用时抛出错误
V1.1__Insert_Records.sql
对于
table not found
是的。
如果我移动
具体的
里面的文件夹
db/migration
,相同版本的重复文件出现错误。
有什么建议我应该如何为多个数据库配置迁移文件以使用Flyway?