Search in sources :

Example 1 with ClassicConfiguration

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));
}
Also used : ClassicConfiguration(org.flywaydb.core.api.configuration.ClassicConfiguration) Location(org.flywaydb.core.api.Location) DependsOn(org.springframework.context.annotation.DependsOn) Profile(org.springframework.context.annotation.Profile) Bean(org.springframework.context.annotation.Bean)

Aggregations

Location (org.flywaydb.core.api.Location)1 ClassicConfiguration (org.flywaydb.core.api.configuration.ClassicConfiguration)1 Bean (org.springframework.context.annotation.Bean)1 DependsOn (org.springframework.context.annotation.DependsOn)1 Profile (org.springframework.context.annotation.Profile)1