Repository navigation
fix: require explicit opt-in for Flyway history repair - #657
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Startup currently calls
Flyway.repair()before every migration. If an already-applied SQL file changes, startup replaces its recorded checksum before validation can reject the change, even though the database has not executed the changed SQL. PostgreSQL and Kingbase profiles additionally disable validation.Change
mateclaw.flyway.auto-repair=truefor history repair and log a warning when enabled.Compatibility
An existing installation, including Desktop, with a changed applied migration may now fail startup. Operators should back up and compare the applied scripts and actual schema before any one-time repair. Keeping auto-repair enabled or disabling validation is not the default upgrade strategy.
Validation
mvn -B -o -pl mateclaw-server -am -Dtest=FlywayRepairConfigTest -Dsurefire.failIfNoSpecifiedTests=false test.Tests use real isolated H2 migration fixtures and load all four shipped database profile configurations; they do not connect to PostgreSQL, MySQL or Kingbase servers. No production database was accessed.