Using Flyway to load data conditionally per environment

后端 未结 4 1692
感情败类
感情败类 2020-12-24 13:36

Does flyway support conditional execution of a script, per environment?

For example, if I have test data, can I create a test data script folder thats only loaded i

4条回答
  •  抹茶落季
    2020-12-24 14:24

    For future visitors, this is a solution for DB specific sql, but applies to data loading too. https://flywaydb.org/documentation/faq#db-specific-sql

    You can set the flyway.locations=sql/common,sql/data property, and this can be set to different values with spring profiles(dev/test/prod), omitting the sql/data scripts on production.

提交回复
热议问题