Using Flyway with Spring Boot

Mukul Jha
4 min readAug 25, 2024

Before using Flyway with Spring Boot, it’s important first to understand Flyway itself.

Flyway

Flyway is a migration tool that automates the management of the database migration. It is an open-source database migration tool that automates the process of managing the evolving database schemas.

Two popular tools in this domain are Flyway and Liquibase. Today, we will focus on discussing Flyway.

With Flyway, developers can automate version control for their databases, making it easier to maintain, update, and track schema changes over time.

Key Features of Flyway

1. Version Control:

Flyway organizes database migrations into versioned scripts, which are applied sequentially to the database. These scripts typically follow a naming convention like

a. Versioned Migrations: Versioned migrations are assigned unique version numbers, and Flyway applies them in the specified order. The migration files are stored in the project and are executed in sequence to maintain the integrity and consistency of the database schema. Each migration file follows the format V<version>__<description>.sql, where:

  • Prefix: V, indicating it is a versioned migration.

--

--