I have a composite JAR with SQL + Java migrations. For backward compatibility I have to distinguish between a new installation and an update. I use prefixes "I" (new installation) and "V" (update):
configuration.sqlMigrationPrefix("I");
This works fine for SQL migrations, but for a Java migration class I1_1__test.class I get the error:
org.flywaydb.core.api.FlywayException: Invalid JDBC migration class name: db.migration.test.I1_1__test=> ensure it starts with V or R, or implement org.flywaydb.core.api.migration.MigrationInfoProvider for non-default naming
In the documentation, there is a mention of a possibility to implement my own MigrationResolver coupled with a custom MigrationExecutor.
The problem is, I still need to keep the SqlMigrationResolver active, and I find very exhausting to re-implement both strategies (SQL and Java) almost from scratch just because of this.
Is there a better and simpler way?
PS: there is an old pull request, unfortunately not merged, for this feature.