Guest User

Untitled

a guest
Nov 24th, 2018
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. package sample.flyway;
  2.  
  3. import org.flywaydb.core.Flyway;
  4.  
  5. public class Migrations {
  6. public static void main(String[] args) throws Exception {
  7. Flyway flyway = new Flyway();
  8. flyway.setDataSource(System.getenv("JDBC_DATABASE_URL"),
  9. System.getenv("JDBC_DATABASE_USERNAME"),
  10. System.getenv("JDBC_DATABASE_PASSWORD"));
  11. flyway.migrate();
  12. }
  13. }
  14.  
  15. release: java -cp target/spring-boot-sample-flyway-1.0.0.jar:target/dependency/* sample.flyway.Migrations
  16.  
  17. spring.datasource.url: ${JDBC_DATABASE_URL:}
  18. spring.datasource.username = ${JDBC_DATABASE_USERNAME:}
  19. spring.datasource.password = ${JDBC_DATABASE_PASSWORD:}
  20. spring.datasource.driverClassName=org.postgresql.Driver
  21.  
  22. dependencies {
  23. ....
  24. implementation('org.flywaydb:flyway-core')
  25. }
Add Comment
Please, Sign In to add comment