Which version and edition of Flyway are you using?
Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)
Spring Boot integration
Which database are you using (type & version)?
Which operating system are you using?
What did you do?
Wrote a migration with a simple conditional DROP INDEX statement:
DROP INDEX IF EXISTS blog_post__name_idx;
What did you expect to see?
Successful migration and a dropped index.
What did you see instead?
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocation of init method failed; nested exception is org.flywaydb.core.api.FlywayException: Unable to parse statement in db/migration/common/V2__drop_blog_post_name_idx.sql at line 1 col 1: Incomplete statement at line 1 col 1: DROP INDEX IF EXISTS blog_post__name_idx;
Also when I debug into the HSQLDBParser in line 77 I can see that the INDEX token has the type IDENTIFIER which seams wrong and it is therefore looking for the token DROP in CONDITIONALLY_CREATABLE_OBJECTS which it won't find. It is then increasing the blockDepth and failing later because of that.