hmc
hmc

Reputation: 85

Error in FlyWay migration after State/BaselineMigration scripts based migration

I tried the State/BaselineMigration feature with a trial key. https://flywaydb.org/documentation/concepts/baselinemigrations FlyWay migration execute the script and move to the correct version properly. But all the migration runs on top of that is failing

Start with S2__xxx.sql then it creates a row in schema table with version 2 and type "SQL_STATE_SCRIPT"

When performing flyway migration again with or without more scripts such as V3__xxx.sql it always produce an error

Exception in thread "main" org.flywaydb.core.api.exception.FlywayValidateException: Validate failed: Migrations have failed validation Detected applied migration not resolved locally: 2. If you removed this migration intentionally, run repair to mark the migration as deleted. Need more flexibility with validation rules? Learn more: https://rd.gt/3AbJUZE

setting ignore missing flag or pattern doesn't help as well. Repair will solve only if there is a file with V2_xxx.sql

I tried with 7.x and 8.x versions with java and 8.x with command line. all seems to have this issue.

Is there anyway to solve this or i am violating the intended usage?

My intension is we have existing setup with many versioned scripts lets say 10. When going to perform a fresh installation go with a S10__ instead of multiple versions but we should able to migrate future versioned scripts in ci/cd pipeline. With this issue that can not be done

EDIT - This is fixed with 8.0.0 version

Upvotes: 0

Views: 917

Answers (1)

Julia Hayward
Julia Hayward

Reputation: 2155

We believe this is a bug, and a fix will go into the next v8 beta.

Upvotes: 1

Related Questions