PASS Summit West 2026, November 9-11|Register now

generate – Automate creating Flyway Versioned and Undo scripts

Follow along with the workbook here 

Generates a migration script based on the differences from an artifact produced by diff. The version, description and location of the migration script can be specified or auto-generated by Flyway. Baseline, versioned and undo script types can be generated.  

To create a Versioned script that will work in Production and other downstream environments, we first need to import that schema into our project. This makes an empty database look like Production, so if our new DDL scripts work against it, we can be confident they’ll work once they reach Production.   

That imported schema is our Baseline which can be a Backup file, a Snapshot, or as in our demo – a script.  

We use the generate command to create that Baseline script, make a few changes to Development and import those to our schema model.  

Finally, we compare the schema model to our migrations – using the shadow environment as our buildEnvironment – and generate the Versioned and Undo scripts.   

Documentation | How-to: Use the CLI to generate migrations 

This document contains proprietary information and is protected by copyright law.
Copyright © 2026 Red Gate Software Limited. All rights reserved