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 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Elena Rostova

Elena Rostova

Lead Health, Wellness & Medical Journalist

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.

Share this article
Twitter Facebook Pinterest