concept Flyway in category spring

appears as: Flyway
Spring Boot in Action

This is an excerpt from Manning's book Spring Boot in Action.

Defining database migration with Flyway

Flyway is a very simple, open source database migration library that uses SQL for defining the migration scripts. The idea is that each script is given a version number, and Flyway will execute each of them in order to arrive at the desired state of the database. It also records the status of scripts it has executed so that it won’t run them again.

Listing 8.2. A database initialization script for Flyway

As you can see, the Flyway script is just SQL. What makes it work with Flyway is where it’s placed in the classpath and how it’s named. Flyway scripts follow a naming convention that includes the version number, as illustrated in figure 8.1.