Reputation: 432
I need to set up Flyway such that certain sql scripts are run in UAT instances and certain sql scripts are run in production instances. How do I go about implementing this? Should I have two different sets of configuration files specific to each machine? Or should I use flyway.locations
property to achieve this?
Upvotes: 2
Views: 250
Reputation: 7855
You can use Spring-Profiles (see https://www.baeldung.com/spring-profiles) and define on each profile a other location.
Otherwise you can define an environment-variable (spring.flyway.location=${ENV_VAR:defaultPath}
).
And the last option: Implement Flyway the "manual way". See https://flywaydb.org/documentation/api/hooks
Upvotes: 1