0

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

1
  • Glad this bug was fixed. We've since built an automated testing service in "Flyway Hub" which should help ensure that your set of migrations is always valid. If you want to try it, simply visit hub.flywaydb.org - let us know if this helps! (this works for SQL Server, Postgres, MySQL and MariaDB for now) Commented Nov 9, 2021 at 11:24

1 Answer 1

1

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

1
  • Is there a reported issue?
    – hmc
    Commented Oct 7, 2021 at 4:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.