Are you interested in learning more about Flyway command line (CLI) and how to connect in different ways? In this tutorial, we will walk you through the process of downloading Flyway and getting started with it.
Setup
The setup for Flyway is straightforward. The Community version is free, but there are also Teams and Enterprise editions available. In this tutorial, we will focus on the Community version.
1. Download Flyway: Visit the Flyway website and download the Community version. Choose the appropriate version for your operating system. For example, if you are using Windows, download the Windows version.
2. Extract Flyway: Once the download is complete, unzip the downloaded file. Choose a location on your computer where you want to store Flyway. For example, you can create a folder named “flyway” in your “Utilities” folder and extract the files there.
3. Add Flyway to PATH: To use Flyway from the command line, you need to add it to your system’s PATH environment variable. On Windows 10 or 11, follow these steps:
- Open the Control Panel by pressing Windows+I and searching for “Control Panel”.
- In the Control Panel, search for “environment” and click on “Edit the system environment variables”.
- In the System Properties dialog, click on the “Environment Variables” button.
- In the “User variables” section, find the “PATH” variable and click on “Edit”.
- Add a new entry for the folder where you extracted the Flyway files. For example, if you extracted Flyway to “c:\utilities\flyway”, add “c:\utilities\flyway” as a new entry.
- Click “OK” to save the changes.
That’s it! Flyway is now installed on your system. To verify the installation, open the command line and type “flyway version”. If everything is set up correctly, you should see the version of Flyway installed on your machine.
Now that you have Flyway set up, you can start using it to manage your database migrations. Flyway provides a powerful and flexible way to handle database schema changes in a controlled and repeatable manner.
In future blog posts, we will explore more advanced features of Flyway and demonstrate how to use it in real-world scenarios. Stay tuned!