use of org.flywaydb.core.api.configuration.ClassicConfiguration in project dhis2-core by dhis2.
the class FlywayConfig method flyway.
@Bean(value = "flyway", initMethod = "migrate")
@Profile("!test-h2")
@DependsOn("dataSource")
public Flyway flyway(DhisConfigurationProvider configurationProvider, DataSource dataSource) {
ClassicConfiguration classicConfiguration = new ClassicConfiguration();
classicConfiguration.setDataSource(dataSource);
classicConfiguration.setBaselineOnMigrate(true);
classicConfiguration.setOutOfOrder(configurationProvider.isEnabled(FLYWAY_OUT_OF_ORDER_MIGRATION));
classicConfiguration.setIgnoreMissingMigrations(true);
classicConfiguration.setIgnoreFutureMigrations(false);
classicConfiguration.setGroup(true);
classicConfiguration.setLocations(new Location(FLYWAY_MIGRATION_FOLDER));
classicConfiguration.setMixed(true);
return new DhisFlyway(classicConfiguration, configurationProvider.isEnabled(FLYWAY_REPAIR_BEFORE_MIGRATION));
}
Aggregations