Tony C.
Tony C.

Reputation: 313

Flyway migration not recognizing beforeValidate.sql

I'm getting the following error when trying to do a Flyway migration using the beforeValidate.sal callback file:

Wrong migration name format: beforeValidate.sql(It should look like
this: 1.2__Description.)

It appears that Flyway does not recognize that this is the name of a callback script.

I tested this back in December and it was working. But when I try it now, I get that error.

UPDATE: Finally had some more time to look into this. This functionality was previously working with Flyway 4.1.2. When I rollback to that version, things work as expected. It is not working with Flyway 5.0.4 (which we had upgraded to in our codebase) or the latest Flyway 5.0.7. Did Flyway either drop support for this feature or possibly change something about it that is not documented?

UPDATE2: Narrowed this down some more. This still worked in Flyway 4.2.0, but does not work in Flyway 5.0.2. Also, note we are using Gradle, so this is failing with the Gradle plugin. I could not try with Flyway 5.0.0 or 5.0.1 since the Gradle plugin for those versions does not appear to be available.

Upvotes: 0

Views: 827

Answers (1)

Tony C.
Tony C.

Reputation: 313

Finally tracked the issue down to a mis-configuration. We use the Gradle plugin and we had not updated the setting to account for sqlMigrationSuffixes now being multi-valued. We were still setting it to

sqlMigrationSuffixes = '.sql'

when it should be set to

sqlMigrationSuffixes = ['.sql']

Apparently this was enough in our case to confuse Flyway and cause it to not recognize beforeValidate.sql as one of the callback scripts.

Upvotes: 1

Related Questions