Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package sample.flyway;
- import org.flywaydb.core.Flyway;
- public class Migrations {
- public static void main(String[] args) throws Exception {
- Flyway flyway = new Flyway();
- flyway.setDataSource(System.getenv("JDBC_DATABASE_URL"),
- System.getenv("JDBC_DATABASE_USERNAME"),
- System.getenv("JDBC_DATABASE_PASSWORD"));
- flyway.migrate();
- }
- }
- release: java -cp target/spring-boot-sample-flyway-1.0.0.jar:target/dependency/* sample.flyway.Migrations
- spring.datasource.url: ${JDBC_DATABASE_URL:}
- spring.datasource.username = ${JDBC_DATABASE_USERNAME:}
- spring.datasource.password = ${JDBC_DATABASE_PASSWORD:}
- spring.datasource.driverClassName=org.postgresql.Driver
- dependencies {
- ....
- implementation('org.flywaydb:flyway-core')
- }
Add Comment
Please, Sign In to add comment