Tutorial - Drift Report for deployments using embedded snapshot
Published 11 November 2025
- Save a snapshot on deployment using one of the following options
- If using state-based or migrations-based deployments
flyway deploy -environment=production -saveSnapshot=true
- If using migrations-based deployment
flyway migrate -baselineOnMigrate=true -environment=production -saveSnapshot=true
- Or, take a snapshot ad-hoc
flyway snapshot -source=production -filename="snapshotHistory:ad-hoc deployment"
In the examples above, "production" is the ID of a database environment that is defined in the project and provides the connection information for the database that you want to capture in a snapshot.
If this is the first time you're saving a snapshot in the target database, then the snapshot history table will be created.
- If using state-based or migrations-based deployments
- Use the saved snapshot in the target database to check for drift
flyway check -drift -environment=production -failOnDrift=true
- Navigate to the Migration scripts page
- Connect to your target environment, by selecting the relevant connection from the Target database dropdown, or adding a new target configuration.
- Select Check from the command dropdown in the right hand pane
- Check the drift flag under the command dropdown
- Expand the Advanced settings and click Add parameters
- Select check.failOnDrift from the drop down. You can start typing to limit the results and find the parameter you need easier.
- Enter true for the parameter value.
- Click Add parameter.
- Click Back.
- Click Run check
- Review the report
In this example, 1 object has changed since the snapshot was taken. Drilling down, you can see the exact changes. A new "DriftedColumn" was added to the Customers table.
