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:
- Migration instructions on folder src/main/resources/db/migration
- Flyway configurations on file src/main/resources/flywayConfig.properties
- Maven plugin for Flyway on pom.xml
The main commands are below.
Flyway also creates one control table on the database where it is possible to watch the changes.