Fork me on GitHub

Using Flyway for Database customization

pg-embedded offers the FlywayPreparer that uses the Flyway Database migration framework for DDL preparation and database migration.

try (DatabaseManager manager = DatabaseManager.multiDatabases()

    // apply all flyway migrations from the db/testing classpath location
    // to every database handed out by this manager

    .start()) {

The FlywayPreparer is customizable by using the FlywayPreparer.addCustomizer() and FlywayPreparer.addCustomizers() methods which can augment the Flyway FluentConfiguration instance that is used to create the Flyway migrator.