Search code examples
spring-bootconfigurationyamlflyway

How to configure Flyway with Yaml?


I have a spring boot project, and I need to configure Flyway in my application.yml file.

Does anyone know how to do this with Yaml?


Solution

  • Look into this Flyway doc

    Application.yml

    spring:
      datasource:
        driverClassName: ${DRIVER}
        url: ${DB_URL}
        username: ${DB_USERNAME}
        password: ${DB_PASSWORD}
      jpa:
        show-sql: true
      flyway:
        enabled: true
        validate-on-migrate: true
    

    Dependency

    implementation 'org.flywaydb:flyway-core'