建设工程信息发布网站,网络运维是做什么的,国外服务器多少钱一个月,建筑找工作平台文章目录 业务场景场景一场景二 业务场景 随着项目版本迭代#xff0c;数据库结构也会变动。如果一个项目引用其他项目的jar包#xff0c;并且需要执行对应jar包的flyway脚本#xff0c;就需要配置flyway.locations 场景一
正常情况下#xff0c;在一个项目中可以在yml文件… 文章目录 业务场景场景一场景二 业务场景 随着项目版本迭代数据库结构也会变动。如果一个项目引用其他项目的jar包并且需要执行对应jar包的flyway脚本就需要配置flyway.locations 场景一
正常情况下在一个项目中可以在yml文件中指定多个flyway脚本的地址比如:可以正常执行
spring:datasource:type: com.zaxxer.hikari.HikariDataSourceurl: jdbc:postgresql://192.168.x.xx:5432/coreusername: xxxpassword: xxxxxxxhikari:poolName: Hikariauto-commit: falseflyway:enabled: trueschemas: publicencoding: UTF-8locations: - classpath:db/migration/db1- classpath:db/migration/db2场景二
但是如果该模块还引用了其他模块该模块也有flyway需要执行新增下述配置但file/db/migration文件夹下的脚本不会生效
/dependenciesdependencygroupIdcom.xx.xx/groupIdartifactIdinfra-xx-xx/artifactIdversion${project.version}/version/dependency
/dependenciesflyway:locations:- classpath:db/migration/db1- classpath:db/migration/db2- classpath:file/db/migration解决方案 该配置文件必须配置在依赖模块的yml文件中