Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn on incompatible class change #1757

Closed
nvartolomei opened this issue Aug 24, 2017 · 2 comments
Closed

Warn on incompatible class change #1757

nvartolomei opened this issue Aug 24, 2017 · 2 comments
Labels
Milestone

Comments

@nvartolomei
Copy link

@nvartolomei nvartolomei commented Aug 24, 2017

What version of Flyway are you using?

4.2.0

Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin, SBT plugin, ANT tasks)

SBT plugin

What did you do?

Tried to migrate this

import java.sql.Connection

import org.flywaydb.core.api.migration.jdbc.JdbcMigration
import org.json4s._
import org.json4s.ext.JavaTypesSerializers

class V42__Some_migration extends JdbcMigration {
  implicit val formats = DefaultFormats ++ JavaTypesSerializers.all

  override def migrate(conn: Connection): Unit = {
    // ...
  }
}
What did you expect to see?

An error at least.

What did you see instead?

Using flyway 4.0.3 sbt 0.13.13 and scala 2.11 worked as expected.
After upgrading to sbt 0.13.16 and scala 2.12.3, migrations failed with java.lang.NoSuchMethodError: scala.Product.$init$(Lscala/Product;)V exception somewhere in json4s code. I suspect this is because of some conflicts between sbt's scala 2.10 and scala 2.12. I can accept this to some degree.

The funny thing is that after upgrading to flyway 4.2.0, migrations are run successfully, except that V42 migration mentioned above is skipped completely.

ps. if I delete implicit val formats = DefaultFormats ++ JavaTypesSerializers.all declaration, flyway will see this migration.

@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Aug 24, 2017

SBT 0.13.x is only compatible with Scala 2.10.x

Not a Flyway issue.

@nvartolomei
Copy link
Author

@nvartolomei nvartolomei commented Aug 25, 2017

@axelfontaine I perfectly understand that the issue I have is caused by sbt 0.13 and scala 2.12 incompatibility, the issue instead says that flyway behaviour under such conditions changed and now it is swallowing the error, since 0baf57e.

I tried to find commit that changed the behaviour of flyway under this environment.
Would you mind at least raising logging level, to warn?

} catch (IncompatibleClassChangeError e) {
LOG.debug("Skipping incompatibly changed class: " + className);
continue;

@axelfontaine axelfontaine reopened this Aug 25, 2017
@axelfontaine axelfontaine added m: Core and removed r: invalid labels Aug 25, 2017
@axelfontaine axelfontaine added this to the Flyway 5.0.0 milestone Aug 25, 2017
@axelfontaine axelfontaine changed the title Missing migrations Warn on incompatible class change Nov 26, 2017
@axelfontaine axelfontaine added the t: bug label Nov 26, 2017
axelfontaine added a commit to flyway/flywaydb.org that referenced this issue Nov 26, 2017
dohrayme pushed a commit to dohrayme/flyway that referenced this issue Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.