I am trying to integrate flyway to my existing Spring boot app. My requirement is, the default table created by flyway needs to be created on different DB schema and my applications actual table migration must happen on different schema. Reason being, no addition table must be created on the applications DB schema. Currently we are using Mysql

2 Answers

0
iranichai On

We had a Spring Boot app with the flyway configuration in application.properties file for different environments:

    flyway.enabled=true
    flyway.url=jdbc:postgresql://localhost:5432/finance
    flyway.schemas=user
    flyway.password=password
    flyway.user=postgres
    flyway.baseline-on-migrate=true

We had the application-dev.properties, application-local.properties and application-aws.properties with the configuration specific to the environment

0
Venu Duggireddy On

Flyway provides a property flyway.schemas. When the flyway.schemas property is set (multi-schema mode), the schema history table is placed in the first schema of the list.

https://flywaydb.org/documentation/commandline/migrate.html

ex:flyway.schemas=schema1,schema2,schema3