I’ve been working on a demo for a customer. Part of the demo uses a new Redgate product, but Flyway is a part of that. In testing a couple things, I realized that I didn’t have FlywayDB installed on this new machine, so I did a quick walkthrough.
This is actually simple, or fairly simple. First, download the .zip file from Flyway.
Next, put this somewhere. For me, I wanted to be organized, so I put this in C:\Program Files\Red Gate. This did require some UAC approval to unzip the download into this spot.
Once I did this, I saw the flyway.cmd file in the subfolder. The instructions note I need to add this to my path.
There are different ways to add things to the path, but the quickest for me on Windows 10, is to get to the properties of “This PC”. There is an advanced system settings here.
This let’s me see properties, including the “Environment Variables” at the bottom.
Clicking this shows me the various system variables, including the PATH.
If I edit this, I get a standard dialog where I can add the Flyway folder.
Once done, I can test this with “flyway info” at a command prompt.
One note, if I have a command prompt open, I need to restart it to get the new path.
This is an interesting item. I didn’t directly find an answer in the quick start. Most people probably use the Community edition, so they don’t need a key. I, however, wanted to play with the Enterprise version. I got a key from Redgate, and then set the environment variable. As you can see below, this isn’t enough. I got an error that I didn’t have a license.
I wasn’t sure if flyway.licenseKey is a file or a setting. I looked around a bit, and on the download and install page, I found an item doe the Configuration. This mentions that the first place Flyway looks is the install folder/conf/flyway.conf. Aha!
I looked in the conf folder under my Flyway install. Under here is the flyway.conf file, which is a key-value configuration file. It reminds me of the old Windows 3.1 .ini files.
When I open this, I see a lot of values. These are mostly commented out with a #. If you need to enable a value, remove the comment at the start of the line.
Scrolling to the bottom shows me that the last entry is for the license key. I removed the comment character (# ) and then pasted in my key.
The next time I ran flyway info I see this:
No license message, though obviously I haven’t set up the connections yet.
That gets me started, and I know things are installed. Now I need to start using it, which is something for another post.