@Singleton
public class FlywayMigrator
extends java.lang.Object
The Flyway configuration should be: flyway.enabled = true flyway.datasources.*.enabled = false
This ensures that Flyway won't run automatically the migrations. The following service can then be injected later
and execute run
to execute the migrations based on a given FlywayConfigurationProperties
.
Modifier and Type | Method and Description |
---|---|
void |
run(FlywayConfigurationProperties config,
javax.sql.DataSource dataSource)
Run the Flyway migrations for a specific config and a DataSource.
|
public void run(FlywayConfigurationProperties config, javax.sql.DataSource dataSource)
config
- The FlywayConfigurationProperties
dataSource
- The DataSource