3
votes

I have a completely same project source and sql script in both windows and ubuntu client, development platform. when I compile and try to deploy the project on my linux server, I receive this exception only for my linux version package.

Caused by: org.flywaydb.core.api.FlywayException: Validate failed. Found differences between applied migrations and available migrations: Migration Checksum mismatch for migration V2__xxx_module.sql: DB=-1434535307, Classpath=-282428834 at org.flywaydb.core.Flyway.doValidate(Flyway.java:1020) at org.flywaydb.core.Flyway.access$300(Flyway.java:52) at org.flywaydb.core.Flyway$1.execute(Flyway.java:925) at org.flywaydb.core.Flyway$1.execute(Flyway.java:919) at org.flywaydb.core.Flyway.execute(Flyway.java:1320) at org.flywaydb.core.Flyway.migrate(Flyway.java:919)

it seems there is platform dependency in version 3.1 too. I really need to work with both OS platform, so is there any way to fix that?

Update :

I saw that still many peoples have a same problem, so here is my way to fix the problem.

I just turned off the validation and waiting for flyway 4 that they said that this problem is fixed there.

Flyway flyway = new Flyway(); 
...
flyway.setValidateOnMigrate(false);
3

3 Answers

4
votes

This behaviour is fixed in Flyway 4.0. See https://github.com/flyway/flyway/issues/253

2
votes

This is a known issue with Git: https://github.com/flyway/flyway/issues/253

You can work around it by properly configuring CRLF handling in .gitattributes to have consistent line endings (LF) across all platforms by for example adding * text eol=lf and only adding exceptions for the binary formats.

1
votes

You have 3 options:

  1. use flyway version 4.0
  2. use maven Flyway.repair()
  3. Delete SQL file. Clean and rebuild. Create SQL file again.