New Videos on Advanced Flyway Features: Target, Undo, CherryPick, Mark as Applied, and Dry Runs

Flyway helps you automate deployments for more than 20 different database platforms.

My favorite thing about Flyway is that it’s easy to get started. But although Flyway feels simple, it also offers rich functionality which supports you in complex real-world scenarios.

I’ve just published a few videos digging into these features.

Limiting Flyway deployments with target (1.5 minutes)

Sometimes you only want to deploy changes up to a certain version to your database. The target option in Flyway migrate lets you do just that!

Roll back database changes with Flyway undo and cherryPick (4.5 minutes)

In this video I show how Flyway’s undo command allows you to roll back database changes, and how this can powerfully combine with the cherryPick option.

  • 00:00 Finding an undoable migration in flyway info
  • 00:49 Running flyway undo
  • 01:25 Pending migrations after running flyway undo
  • 02:00 Rolling forward with flyway migrate
  • 02:30 Why we have a cherryPick option
  • 03:00 Running flyway -cherryPick=002 migrate to roll back version 2

Marking scripts as applied with SkipExecutingMigrations (4 minutes)

At times you may have scripts run against your database manually outside of your Flyway pipeline — perhaps as part of emergency troubleshooting. You can mark those scripts as applied in flyway by using SkipExecutingMigrations= true.

This works with Flyway migrate and Flyway undo , and also combines with the cherryPick option.

  • 00:00 How my example migrations appear when run normally
  • 00:50 A scenario when we would want to mark migrations as applied
  • 01:16 Demo of skipExecutingMigrations with flyway migrate
  • 02:07 Combining with cherryPick and flyway undo
  • 03:34 Reviewing flyway info

Create a DryRun script with Flyway (3 minutes)

Dry Run‘ scripts are incredibly useful in the review and deployment processes for your database changes when you are using Flyway.

  • 00:00 Viewing our pending migrations
  • 01:05 Scenarios when Dry Run scripts are useful
  • 01:58 How to generate the Dry Run script
  • 02:25 Reviewing the dryrun.sql file

You can also check out this tutorial on Dry Runs.

Ready to learn more?

For installation and basic commands, watch our 30 minute Getting Started with Flyway course on Redgate University

To get started with the Flyway Docker Image in an AWS CodePipeline, read A Flyway Migration Using Docker

Learn about how to properly name your Flyway files in this article

Download the whitepaper, Enabling fast and easy database migrations for high-performing DevOps teams with Flyway

Tools in this post