Tag: Redgate

  • Friday Flyway Tips–Commit and Push

    Flyway Desktop includes version control features with Git. One thing that was added in v6.5+ was the ability to commit and push.

    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.

    All in One Press

    This isn’t a big change, but it is one that customers have asked for. On the version control tab, when you have changes, they are listed with a commit button in the lower right.

    2023-08-25 16_06_35-Flyway Desktop

    We’ve added a drop down to this.

    2023-08-25 16_07_13-Flyway Desktop

    If you click this, you now have commit or commit and push options.

    2023-08-25 16_07_17-Flyway Desktop

    Pick the lower one, and you’ll get things committed and pushed up.

    2023-08-25 16_17_42-Flyway Desktop

    The choice isn’t saved, which I think isn’t a great design choice, but for now, you do have the option with each commit.

    Try it 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:

    https://youtu.be/QsWVcYxFdnM

  • Running Flyway from PowerShell–A Gotcha

    I ran across an interesting gotcha while trying to run a Flyway command from PowerShell. Specifically, the snapshot command and providing a parameter that is the snapshot.filename parameter.

    Someone reported an issue with Snapshot, so I tried it from a command line. It worked fine for me, but a sharp Redgate developer noted that the person was running something like this from PowerShell:

    flyway snapshot -snapshot.filename="deployed1.snapshot" -url="jdbc:sqlserver://localhost;databaseName=FWSimpleTalk_1_Dev;encrypt=true;integratedSecurity=true;trustServerCertificate=true"

    As you can see below, this caused an error.

    2023-08-28 11_52_27-Window

    I checked my version. Surely “flyway snapshot” was valid, and it was.

    However, there is an issue here with PowerShell and the parameter. In this case, the PoSh will try to interpret this as

    The issue is lightly explained in this SO question, though I can’t quite figure out where this is documented. However, using quotes around the parameter name fixes this. Note, I switched the parameter value to single quotes.

    flyway snapshot "-snapshot.filename='deployed1.snapshot'" -url="jdbc:sqlserver://localhost;databaseName=FWSimpleTalk_1_Dev;encrypt=true;integratedSecurity=true;trustServerCertificate=true"

    As you can see, this works.

    2023-08-28 08_25_29-Window

    PowerShell is closed to command shell, but not the same. Keep that in mind as you build automation. Be wary of how your parameter values might be interpreted and test lots of values.

  • Friday Flyway Tips: Visualizing Undo Scripts

    One nice thing with Flyway Enterprise is that it will automatically generate the undo scripts for migration scripts. However, it used to be that finding these and seeing the script was hard. It’s easier after Flyway Desktop 6.5.2

    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.

    Undo Scripts

    If you have Flyway Enterprise, you can have Flyway Desktop automatically generate scripts: both forward (versioned) and undo scripts.

    The config option for this is in project options, which is in the upper right.

    2023-08-10 15_53_53-Flyway Desktop

    Clicking this

    2023-08-10 15_53_57-Flyway Desktop

    Once have this, if you add a new object, when you generate the migration script, Flyway Desktop will generate the undo script. In the older UI (pre 6.5) this was a script below the generated script, which meant you had to scroll down, or up and down to compare the forward and undo scripts.

    The new UI is better. Now there is just a button. Let me show you how to do this.

    First, I have a few changes in the schema model. I’ll select one.

    2023-08-21 12_27_19-Flyway Desktop

    Now I’ll generate the scripts. When I do that, I see the two scripts. The versioned (forward) script is first, and you can see the “Undo” at the bottom.

    2023-08-21 12_28_05-Flyway Desktop

    Below this, the rest of the undo script is visible if I scroll down.

    2023-08-21 12_28_12-Flyway Desktop

    It’s a bit of a pain to scroll up and down, so there is a small improvement in the migrations tab. If I go there, I can find my script at the bottom of the list and click it.

    2023-08-21 12_30_33-Flyway Desktop

    At the top of the script, in the bar, there is now a set of toggle buttons for version and undo.

    2023-08-21 12_24_35-Flyway Desktop

    I can click back and forth to easily see both scripts. The V script is above, and the undo is below.

    2023-08-21 12_39_44-Flyway Desktop

    Try it 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:

     

  • Chicago Database DevOps in a Day Workshop

    I’m heading to Chicago today for the Redgate Database DevOps in a Day workshops. This is the first of many on the US tour. I’ll be at 5 of them, but there will be another 5 where Ryan, Grant, or our Solutions Engineers will run the show.

    If you’ve registered, please say hi, introduce yourself, and ask lots of questions. Hopefully you’ll enjoy the day.

    Just a quick trip for me, coming back tomorrow, which is good. I head to the UK Roadshow Friday night..