切换flyway,集成到springbooot

Switch flyway to sprintboot startup instead of using Docke

首先,我的项目是用Gradle进行管理的,所以我在build.gradle引入springboot的flyway依赖,(同理在pom里引入都一样)这里版本号你们可以自己去查找你们在部署或者服务器使用的flyway依赖版本。

dependencies {

    implementation 'org.flywaydb:flyway-core:7.7.3'

}

然后我们的V和R脚本文件,需要按照官方给出的路径放在这里,当然如果你只是通过配置文件实现的话,可以用classpath或者filesystem指定路径

接下里我们去编写我们的配置文件,这里可以用使用.YML的配置文件,或者properties,当然是有优先级的问题的,这个会在我别的文章介绍

这里我选择

直接写在了src/resources/application.properties文件里

猜你喜欢

转载自blog.csdn.net/hanshilong100/article/details/120183293