Last active
March 9, 2017 22:14
-
-
Save willmenn/0a09af7cde88d04317ec24aa7c53cb63 to your computer and use it in GitHub Desktop.
Flyway with Multiples Schemas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
flyway.schemas=SANDBOX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package db.migration; | |
import org.flywaydb.core.api.configuration.ConfigurationAware; | |
import org.flywaydb.core.api.configuration.FlywayConfiguration; | |
import org.flywaydb.core.api.migration.spring.SpringJdbcMigration; | |
import org.springframework.jdbc.core.JdbcTemplate; | |
public class V1_1__MigrationExample implements SpringJdbcMigration, ConfigurationAware { | |
private FlywayConfiguration flywayConfiguration; | |
@Override | |
public void migrate(JdbcTemplate jdbcTemplate) throws Exception { | |
String schema = flywayConfiguration.getSchemas()[0]; | |
//Add code here | |
} | |
@Override | |
public void setFlywayConfiguration(FlywayConfiguration flywayConfiguration) { | |
this.flywayConfiguration = flywayConfiguration; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment