Recently I was working with Flyway Desktop (FWD) and helping a customer work on deploying part of their work. They weren’t sure how easy this could be, but this post follows what I showed them.
Using the ability to run Flyway commands in FWD, we can deploy some migrations and not others. This post shows how to configure this.
I’ve been working with Flyway Desktop for work more and more as we transition from older SSMS plugins to the standalone tool. This series looks at some tips I’ve gotten along the way.
Picking Migrations
I’ve got a FWD project here, and you can see the migrations below. In this case, I’ve selected a target of my QA machine and we can see that I have migrations applied up to 5 and there are pending migrations from 6-8 (ignore the undo).
If I want to apply migration 6, but not 8, I can do that. First, I’ll click the Advanced settings on the right side. When I do that, I see text with a “add parameters” button.
If I click the Add parameters button, I get a drop down that is searchable.
I can start typing “ta” in here and you see matching items. “Target” is the last one and this is the parameter that you want.
The value of the target is the last migration you want to run. In this case, I can pick 6 and it will run only migration 6. If I pick 7, it will run 6 and 7.
Once I do this, I can click back (or add more parameters) and on the main screen I see that target is in blue, as a parameter added. In the command text box, I’ve highlighted this command as added to the CLI.
Note: This text is what you could run in a CI system or at a cmd/shell .prompt
When I click migrate, the command is run and I get output about which migrations ran.
If I close this, then I see 6 is successfully applied (after unchecking only show pending) and 7 and 8 are above target. In another post, I’ll explain those.
Try Flyway Desktop out today. If you haven’t worked with Flyway Desktop, download it today. There is a free version that organizes migrations and paid versions with many more features.
Video Walkthrough
I made a quick video showing this as well. You can watch it below, or check out all the Flyway videos I’ve added: