Flyway migration not working repair required

Viewed 5295

I'm using flyway for migrations. Flyway version is Flyway 3.2.1 by Boxfuse. When I am executing

./flyway migrate -url=jdbc:postgresql://$FLYWAY_DATABASE_HOST/$FLYWAY_DATABASE_NAME -password=$FLYWAY_DATABASE_PASSWORD -user=$FLYWAY_DATABASE_USER

I'm getting following error

"ERROR: Validate failed. Migration Checksum mismatch for migration 80
 Applied to database : -401430104
 Resolved locally    : -485639995

How can I resolve this?

1 Answers

Migration Checksum mismatch means that the contents of a particular migration file has changed since you executed it, and that means that your script collection might not be a faithful representation of the database schema.

If you are happy that the scripts are still good (eg the changes were comments and formatting) then flyway repair with the same URL and credentials will clear this error. If not, then you should either revert the changes, or flyway repair and accept the mismatch.

Related