Hrushikesh Patel
Hrushikesh Patel

Reputation: 296

How to run conditional scripts based on database in the flyway?

How to run conditional scripts based on the database in the flyway. For example, some script needs to run as the main script and some to be run on a specific database. Is it possible this way in the flyway?

Upvotes: 1

Views: 721

Answers (1)

David Atkinson
David Atkinson

Reputation: 5899

My advice would be to save the target-specific scripts in a different subfolder (ie, a subfolder for each target) and when "migrating", specify flyway.locations differently depending on the target.

Upvotes: 2

Related Questions