Flyway uses the old but gold SQL and the migrations are applied based on files’ name order. For instance, V1_1_0__person.sql will be applied before V1_2_0__data.sql.

The name after “__” does not really matter and once a script is executed, you can not change the file anymore.

It can be executed when Spring Boot starts up the application, through Maven command or command line.

On my demo project it is possible to check the following:

The main commands are below.

Commands for Maven plugin

Flyway also creates one control table on the database where it is possible to watch the changes.

Database tables
Control records

Software Engineer. Always learning.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store