From 0ce7c9516af9eaae2313fda7a5f0fcf0c807dec7 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Fri, 20 Jan 2017 15:44:42 +0000 Subject: [PATCH] Document how to configure test- and profile-specific Flyway migrations Closes gh-2753 --- spring-boot-docs/src/main/asciidoc/howto.adoc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spring-boot-docs/src/main/asciidoc/howto.adoc b/spring-boot-docs/src/main/asciidoc/howto.adoc index 9eea2b91d1d..1f321bf96e0 100644 --- a/spring-boot-docs/src/main/asciidoc/howto.adoc +++ b/spring-boot-docs/src/main/asciidoc/howto.adoc @@ -2114,6 +2114,15 @@ in external properties. There is a {github-code}/spring-boot-samples/spring-boot-sample-flyway[Flyway sample] so you can see how to set things up. +You can also use Flyway to provide data for specific scenarios. For example, you can +place test-specific migrations in `src/test/resources` and they will only be run when your +application starts for testing. If you want to be more sophisticated you can use +profile-specific configuration to customize `flyway.locations` so that certain migrations +will only run when a particular profile is active. For example, in +`application-dev.properties` you could set `flyway.locations` to +`classpath:/db/migration, claspath:/dev/db/migration` and migrations in `dev/db/migration` +will only run when the `dev` profile is active. + [[howto-execute-liquibase-database-migrations-on-startup]]