Blog Post

Friday Flyway Tips–Undoing Development Changes

,

I had a customer ask about undoing changes made by developers, similar to what SQL Source Control does. I had to do a little research to show how to do this, which is the tip this week.

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.

Making Changes in Development

I’ve got a few changes I want to make. You can see these in the image below, where I’ve added a column and then a couple of tables.

2024-02-29 11_30_19-Custom Selection

I test this (hopefully) and I come to Flyway Desktop, where I can see all my changes listed in the Schema Model tab.

2024-02-29 11_30_35-Custom Selection

At this point, I realize that I’ve done something I don’t want. I don’t want the column to be named something. Maybe I misspelled it, or maybe I modeled it wrong. I can easily fix this in Flyway Desktop.

At the top, you see there is a Save to Project and Apply to Database set of radio buttons.

2024-02-29 14_17_05-

This is a two way comparison, with the options reversing each other. The Save item will write database changes to the file system in the repo. The Apply will read the repo and make the changes in the database.

In this case, you can see below that when I select the Apply radio button, I get the notification that my column will be deleted.

2024-02-29 11_30_56-Highlight

Once I click “Apply to Database” (the big blue button), these changes are made.

If I check the database, I can see my column is removed, but my tables still exist, since I didn’t check their boxes on the left.

I’ve undone a change. Now I can commit these two tables, if that’s what I need, or I can also add back a better named column and refresh this if needed.

Try Flyway Enterprise 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:

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