Flyway support for Groovy -migrations and conditional nesting for specific conditions

We are working on a Grails project and are exploring Flyway as a db-migration tool for us.

In our current architecture, we rely on Groovy -migration scripts (executed at application startup) for environment-specific conditional data attachments (for example, "some data" in "tableA" for "Production" versus "other-data" in the same table "tableA" for pre-production).

Q1. Does Flyway support Groovy-migration scripts?

Q2. If not, how best can we achieve environment-specific conditional data attachments?

+1


source to share


1 answer


Q1: Java based migrations are loaded as binary classes at runtime. Whether the source is Java or Groovy doesn't matter here. So, yes, writing them in Groovy should work.



Q2: Flyway supports multiple migration download locations . These locations can be configured differently for the environment (in your case for PROD and PRE-PROD). You can use this to include different data depending on the environment the Flyway is in.

+2


source







All Articles