Get the most out of Flyway v7 - Sign up for our webinar on the Redgate Hub ▶ Watch now
When Flyway migrates a database, it looks for migrations that need to be applied, sorts them and applies them in order directly against the database.
This default behavior is great for the vast majority of the cases.
There are however situations where you may want to
Flyway Teams Edition give you a way to achieve all these scenarios using Dry Runs.
When doing a Dry Run, Flyway sets up a read-only connection to the database. It assesses what migrations need to run and generates a single SQL file containing all statements it would have executed in case of a regular migration run. This SQL file can then be reviewed. If satisfactory, Flyway can then be instructed to migrate the database and all changes will be applied. Alternatively a separate tool of your choice can also be used to apply the dry run SQL file directly to the database without using Flyway. This SQL file also contains the necessary statements to create and update Flyway’s schema history table, ensuring that all schema changes are tracked the usual way.
This works transparently with all other Flyway features including SQL and Java migrations, both versioned and repeatable, callbacks, undo migrations, etc.
When using the API directly, the dry run output can be configured using a
java.io.OutputStream, giving you additional
As soon as this property is set, Flyway kicks in dry run mode. The database is no longer modified and all SQL statements that would have been applied are sent to the dry run output instead.
Click here to see a tutorial on using dry runs.
© 2010-2020 Redgate. Made with in Cambridge.
Flyway is a registered trademark of Red Gate Software Ltd.
All other trademarks, trade names, logos or service marks mentioned on this site belong to their respective owners.
This site collects anonymous usage information through Google Analytics.