Spring Boot: Hibernate and Flyway boot order

前端 未结 6 671
一整个雨季
一整个雨季 2020-12-09 03:52

I have created Spring application. Pom xml is attached.

It has a config like this (below) and some db/migration/V1__init.sql for Flyway db migration tool.

It

6条回答
  •  渐次进展
    2020-12-09 04:18

    For more recent users that use Spring Boot +2.1 and as @mota commented into @user3707816's answer, you can use spring.flyway.enabled=false in application.properties and then create a new instance manually:

    Flyway.configure().dataSource(dataSource)
                    .baselineOnMigrate(true)
                    .schemas(PG_DATABASE_SCHEMA)//optional, by default is public
                    .load().migrate();
    

提交回复
热议问题