We are configuraing/starting our flyway migrations in java in our Spring Boot App.
So we have both sql and java migration files.
In certain environments we want extra migrations to run. Basically in a QA env we want to prepare the DB with data for tests.
So I know you can configure multiple migration locations in java.
So I can do something like this
if(isQAenv == true)
{
Flyway.configure().locations("/db/migrations/","db/qaMigrations/")
else{
Flyway.configure().locations("/db/migrations/")
}
My issue is with the versioning and making sure stuff gets executed as intended in all envs.
Do I need to maintain the numbering system to be the correct order?
So lets say I have the following migration scripts that should run in all envs
db/migrations/V1__table1.sql
db/migrations/V2__table2.sql
db/migrations/V4__table2.sql
And this migration only runs in QA env
db/qaMigrations/V3__insert_statements.sql
Now in a non QA env, my beacon_history_table has migration for 1,2,4. Is there any way to avoid this and have something that looks cleaner in the history table?