Skip to content

Commit 0ce7c95

Browse files
committed
Document how to configure test- and profile-specific Flyway migrations
Closes gh-2753
1 parent 93bc34c commit 0ce7c95

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

spring-boot-docs/src/main/asciidoc/howto.adoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2114,6 +2114,15 @@ in external properties.
21142114
There is a {github-code}/spring-boot-samples/spring-boot-sample-flyway[Flyway sample] so
21152115
you can see how to set things up.
21162116

2117+
You can also use Flyway to provide data for specific scenarios. For example, you can
2118+
place test-specific migrations in `src/test/resources` and they will only be run when your
2119+
application starts for testing. If you want to be more sophisticated you can use
2120+
profile-specific configuration to customize `flyway.locations` so that certain migrations
2121+
will only run when a particular profile is active. For example, in
2122+
`application-dev.properties` you could set `flyway.locations` to
2123+
`classpath:/db/migration, claspath:/dev/db/migration` and migrations in `dev/db/migration`
2124+
will only run when the `dev` profile is active.
2125+
21172126

21182127

21192128
[[howto-execute-liquibase-database-migrations-on-startup]]

0 commit comments

Comments
 (0)