在生产数据库上运行Flyway-迁移校验和不匹配 [英] Flyway on production database - Migration Checksum mismatch

查看:878
本文介绍了在生产数据库上运行Flyway-迁移校验和不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每次更改数据库结构时,我都会使用时间戳创建一个新的迁移文件以按顺序执行,使用干净的数据库,迁移命令(使用maven插件或命令行工具)可以完美地运行,但是在生产数据库中,具有相同的数据库结构,但添加了数据,但出现此错误:

Every time I change something from DB structure I create a new migration file using timestamp to execute in order, with a clean database the migrate command (with maven plugin or command-line tool) it works perfectly, but in a production database, with the same DB structure but with data added I got this error:

无法执行目标org.flywaydb:flyway-maven-plugin:3.2.1:migrate (主要)在项目eee-ejb上:org.flywaydb.core.api.FlywayException: 验证失败.迁移的迁移校验和不匹配1430224929 [错误]->应用于数据库:-1639634536 [错误]->已解决 本地:-1412099238

Failed to execute goal org.flywaydb:flyway-maven-plugin:3.2.1:migrate (main) on project eee-ejb: org.flywaydb.core.api.FlywayException: Validate failed. Migration Checksum mismatch for migration 1430224929 [ERROR] -> Applied to database : -1639634536 [ERROR] -> Resolved locally : -1412099238

如何在不断添加数据的生产数据库中使用flyway?

How can I use flyway in a production database where data is constantly added?

推荐答案

这与要添加的数据无关.迁移脚本本身正在被修改.检查的地方之一是Git CRLF规范化问题.

This has nothing to do with data being added. It is the migration script itself that is being modified. One place to check is Git CRLF normalization issues.

更新:Flyway 4.0现在会自动处理此问题.

Update: Flyway 4.0 now automatically takes care of this.

这篇关于在生产数据库上运行Flyway-迁移校验和不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆