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
All SQL migrations will start after Hibernate creates all the tables.
Spring Boot 2.2.2, Flyway 6.0.8
To disable boot for Flyway, insert into resources/application.properties:
spring.flyway.enabled=false
Create separate configuration for Flyway to make it load when Hibernate is ready:
@Configuration
public class FlywayConfiguration {
@Autowired
public FlywayConfiguration(DataSource dataSource) {
Flyway.configure().baselineOnMigrate(true).dataSource(dataSource).load().migrate();
}
}
Start your migration scripts from version 2:
resources/db.migration/V2__fill-tables.sql
V1 is used as a baseline, V1 file will be ignored.