package org.achacha.base.db;

import org.achacha.base.db.provider.JdbcDatabaseConnectionProvider;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.flywaydb.core.Flyway;

/**
 * Database migration
 */
public class DatabaseMigrator {
    private static final Logger LOGGER = LogManager.getLogger(DatabaseMigrator.class);

    public static void migrateTestDatabase(JdbcDatabaseConnectionProvider databaseConnectionProvider) {
        Flyway flyway = new Flyway();

        LOGGER.info("Migrating: {}", databaseConnectionProvider.toString());

        // Migrate
        flyway.setDataSource(databaseConnectionProvider.getDataSource());
        flyway.setLocations("filesystem:db/migration");
        flyway.clean();
        flyway.migrate();
    }
}

@@ -490,140 +490,46 @@
 ay =
- new
  Flyway
-();%0A%0A        LOGGER.info(%22Migrating: %7B%7D%22, databaseConnectionProvider.toString());%0A%0A        // Migrate%0A        flyway.setD
+.configure()%0A                .d
 ataS
@@ -577,17 +577,16 @@
 ource())
-;
 %0A       
@@ -590,19 +590,18 @@
     
-flyway.setL
+        .l
 ocat
@@ -631,17 +631,139 @@
 ration%22)
-;
+%0A                .load();%0A%0A        LOGGER.info(%22Migrating: %7B%7D%22, databaseConnectionProvider.toString());%0A%0A        // Migrate
 %0A       

Fix deprecated Flyway code