Add autoconfig support for Flyway migrations

Flyway starts up with its default settings if it is on the classpath.
You can also ask Boot to barf if the migration scripts are missing.

Fixes gh-730
This commit is contained in:
Dave Syer
2014-05-01 19:37:25 +01:00
parent 68e33b25c1
commit 5548b24c4c
20 changed files with 498 additions and 3 deletions

View File

@@ -1095,6 +1095,20 @@ Spring Boot works fine with higher level migration tools http://flywaydb.org/[Fl
Flyway because it is easier on the eyes, and it isn't very common to need platform
independence: usually only one or at most couple of platforms is needed.
[[howto-execute-flyway-database-migrations-on-startup]]
==== Execute Flyway database migrations on startup
To automatically run Flyway database migrations on startup, add the
`spring-boot-starter-flyway` to your classpath.
The migrations are scripts in the form `V<VERSION>__<NAME>.sql` (with
`<VERSION>` an underscore-separated version, e.g. "1" or "2_1"). By
default they live in a folder `classpath:db/migrations` but you can
modify that using `flyway.locations` (a list). See
{sc-spring-boot-autoconfigure}/flyway/FlywayProperties.{sc-ext}[`FlywayProperties`]
for details of available settings like schemas etc.
There is a {github-code}/spring-boot-samples/spring-boot-sample-flyway[Flyway sample] so
you can see how to set things up.
[[howto-execute-liquibase-database-migrations-on-startup]]

View File

@@ -238,6 +238,9 @@ and Hibernate.
|`spring-boot-starter-jdbc`
|JDBC Database support.
|`spring-boot-starter-flyway`
|Support for Flyway database migrations.
|`spring-boot-starter-liquibase`
|Support for Liquibase database migrations.