How to Work with Flyway Migration Scripts using MySQL Workbench

soul of a nameless bard
3 min readJul 4, 2022

Instructions For Spring Boot Applications

  1. Within the application directory, go to the /api/src/main/resources/db.migrations directory and add the migration scripts by following the correct incrementation. For example, if the latest migration version is V3 then make your script V4 then V5, etc.

2. Run ./gradlew bootRun to run the application and the new migration scripts

3. Go to MySQL Workbench and in the Schemas tab on the top left corner, select the desired database that the migration scripts are for, then click on Tables. Notice that there is a table called schema_version that stores each version of the database.

There should be the migration scripts that were just added to db.migrations.

The success column shown below will have a 1 if the migration script was successful and a 0 if it failed.

--

--

soul of a nameless bard

Research and reflections on various topics in systems and software/hardware engineering, design, biology, consciousness, metaphysics and spirituality