What’s new in Flyway? State-based deployments in Flyway Teams

Historically, Flyway has been a migrations-based database deployment tool. It greatly improves database deployments by tracking what migration scripts have been executed against a target database and applying any pending migration scripts.

Since Redgate acquired Flyway in 2019, we’ve been incorporating Redgate’s database comparison technology into the paid editions (Flyway Teams/Enterprise) so that users can benefit from the best of both worlds:

  • State – object level history to see how each object has changed over time
  • Migrations – full control over how database changes are deployed

Flyway Teams and Enterprise users can use the Schema Model to track a model of their database in version control. The Schema Model is a set of SQL creation scripts for each object and static data (like configuration or reference data in lookup tables) to understand how these have changed over time. This is helpful for visibility and auditing, as it means each database object has its own documented history. This object level history is easier than tracking down how a database object changed over time across multiple migration scripts.

When it comes to deployments, Flyway’s migrations-based approach allows for full control over the scripts that run on downstream environments. There are also specific database changes that are handled more effectively by a migrations-based approach, for example, adding a new not null column without a default, which needs to have some data inserted before the column can be set to not null.

However, we know from speaking with many database professionals that there are also situations when a state-based approach for deployments is preferred. This could be for projects without complex schema changes or projects that mostly update programmable objects like procedures, packages, and functions. Therefore, the latest release of Flyway Desktop includes the capability for Flyway Teams and Enterprise users to do state-based deployments and deploy directly from the Schema Model to a target database. This is a huge advantage and provides each team with the flexibility to work the way they want to. Deploying from the Schema Model works for any database we have comparison technology for, which includes SQL Server, Oracle, PostgreSQL, MySQL, and MariaDB.

With the new deploy from Schema Model functionality, users can select a target database, review differences between the Schema Model on disk and the target database and select which objects they want to deploy. The deployment script can then be reviewed and edited (if needed) before applying it to the target database.

A screenshot showing deploy from Schema Model functionality in Flyway Enterprise desktop

This improves the experience for users who prefer manual state-based deployments because they no longer need to swap out to a separate tool, such as SQL Compare or Schema Compare for Oracle.

Later this year, a command line capability will be released for those who want to automate their state-based deployments. This automated capability will be available to Flyway Enterprise customers and brings even more flexibility for users to optimize their database deployments.

Learn more:

Tools in this post

Flyway

DevOps for the Database

Find out more

Flyway Enterprise

Standardize Database DevOps across the organization

Find out more