Blog Post

Friday Flyway Tips: State-based deployment with Flyway Teams

,

I was asked about state-based deployments in Flyway Teams, so I decided to show how this can work with a quick demo. This post walks through the process.

I’ve been working with Flyway and 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.

A Steady State

I have a Flyway project setup already in Teams. I’ve refreshed the screen and as you can see here, there aren’t any differences between my database and my project in version control.

2025-02_0349

In SSMS, I’ll create a new table in my FWState_1_Dev database. This is where my project is pointed in Flyway Desktop (FWD).

2025-02_0350

I’ve created a new table and it exists. If I  check my QA database, FWSTate_3_QA, I don’t see this object.

2025-02_0351

If I refresh my project in Flyway Desktop (FWD), I’ll see my change. I can pick it and see the code, and then I’ll click “Save to project” in the upper right.

2025-03_0106

Once the code is saved, I see the confirmation and I have the code ready for commit to a VCS. I won’t do that here, though you should.

2025-03_0107

What I want to do now is go to the left bar and select “deploy”, which is the rocket icon.

2025-03_0108

When I do this, I see a blank screen, as I don’t have a target. I can select that on the right if I’ve configured one.

2025-03_0109

If I pick the drop down, you will see my dev and QA environments. I made changes in the dev environment, and want these changes to go to QA. I can also click the “Manage environments” button. Let’s do that.

2025-03_0110

When I do that, I see a list of environments. I use this a lot to double check that I’m deploying to the right place for this project and where to look for changes. If you work across multiple projects as I do, this is handy.

You can see below I’ve selected QA with the green checkmack in the radio button. Once you pick your environment, you can click “Confirm”. If you need a new target, click Configure.

2025-03_0111

I return to the deploy screen, and this time I see the changes that have not been deployed. In this case, that’s one change, but if there were more, I would see them. I can click any object to see the changes, and once I’ve selected what to deploy, I can click deploy.

2025-03_0113

When I click Deploy the script is generated and I see a preview. I also can see that this is from my schema model on disk being deployed to the Qa database. That’s handy as this might take a few minutes and who knows what distractions might appear in my life.

I also can execute this as a transaction or not, and copy the script if I want to examine it in another tool (or format it like SQL Prompt).

2025-03_0114

When I click Deploy, I need to confirm my deployment. Always a good step, though I think if you do this often, your muscle memory will be ready to just click confirm.

2025-03_0115

Once the deployment runs, we see a message this was successful.

2025-03_0116

If I now check the QA database, I see the object.

2025-03_0117

Summary

This post has shown how you can perform manual deployments of changes in a state-based method using Flyway Teams. This is a quick way to move your changes from one machine to another.

Flyway can do much more and for smoother automation, check out Flyway Enterprise.

Flyway is an incredible way of deploying changes from one database to another, and now includes both migration-based and state-based deployments. You get the flexibility you need to control database changes in your environment. If you’ve never used it, give it a try today. It works for SQL Server, Oracle, PostgreSQL and nearly 50 other platforms.

Video Walkthrough

Here is a video of the process below.

Original post (opens in new tab)
View comments in original post (opens in new tab)

Rate

You rated this post out of 5. Change rating

Share

Share

Rate

You rated this post out of 5. Change rating