sagar kancherla
sagar kancherla

Reputation: 159

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?

Upvotes: 2

Views: 16146

Answers (1)

Maxim Popov
Maxim Popov

Reputation: 1227

First of all, you should evaluate flyway repair to tell the flyway that you have fixed the issue and then run flyway migrate.

Upvotes: 3

Related Questions