Flyway - Validate Failed: Detected Failed Migration to Version 1
I Have Initial Sql Script (V1__Init_Schema. Sql) Which Has Syntax Errors and Flyway Execution Got Failed. When I Corrected the Same Sql Script and Rerun My...
I have initial sql script (V1__init_schema.sql) which has syntax errors and flyway execution got failed. When I corrected the same sql script and rerun my spring boot project. It is giving below error:
[org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocation of init method failed; nested exception is org.flywaydb.core.api.FlywayException:
Validate failed: Detected failed migration to version 1
So, flyway doesn't rerun the failed migration scripts? Do I need to provide the corrected sql file as V2?
1 Answer
First of all, you should evaluate flyway repair to tell the flyway that you have fixed the issue and then run flyway migrate.