Flyway错误:migration checksum mismatch for migration

  Developed a system to manage database scripts with Flyway.
  After importing an old version of the database, an error was reported at startup:
Flyway Validate failed:migration checksum mismatch for migration 1.1
->Applied to database:-115594156
->Resolved locally:1541394156Look

  at the prompt message, the error should be that a modified one The content of the upgraded old script caused Flyway to fail to verify the content of the upgraded script.

  I tried to modify the checksum field in the schema_version table to the correct value, but strangely, it didn't work, and the same error was reported. I haven't figured out what the reason is, it's really strange, I don't know where those two values ​​come from? ? ! !

  There are two solutions for searching information on the Internet:
  First, it is impossible for me to use it, that is, delete the error script and all subsequent records in the schema_version table, and re-execute them all. This can result in loss and confusion of existing data.
  Second, use Flyway's modification command to repair. This is more reliable and feasible.
  The process is as follows:
  1. Download Flyway's command line tool.
  2. Modify the configuration file conf/flyway.conf. Mainly database connection, driver, user name, password, etc.
  3. Copy the script to the sql directory.
  4. Execute flyway repair in the DOS window

  and then it's done. This command fixes the verification information for the upgraded script.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326942642&siteId=291194637