Make up migrations with TargetVersion idempotent#1261
Open
brandur wants to merge 1 commit into
Open
Conversation
9269f42 to
cc86558
Compare
Here, try to address #1260 by making up migrations with `TargetVersion` no longer error if we find that the database has already reached that target version. These now return idempotently instead as a user convenience. Down migrations with `TargetVersion` already worked with this way, so although we add a test case to verify this, we don't have to do anything else. Fixes #1260.
cc86558 to
0638ffe
Compare
brandur
commented
May 30, 2026
| ⚠️ **Breaking API change:** `rivermigrate.Migrator.Validate` and `rivermigrate.Migrator.ValidateTx` now take a `*rivermigrate.ValidateOpts` parameter. Pass `nil` to preserve previous behavior. We normally endeavor not to make any breaking API changes, but this one will keep the API in a much nicer state, and is on an ancillary function that most installations won't be using. [PR #1259](https://github.com/riverqueue/river/pull/1259) | ||
|
|
||
| ### Added | ||
| ### Changed |
Contributor
Author
There was a problem hiding this comment.
Think "changed" is actually a bit more appropriate for both these changelog entries.
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.
Here, try to address #1260 by making up migrations with
TargetVersionno longer error if we find that the database has already reached that
target version. These now return idempotently instead as a user
convenience.
Down migrations with
TargetVersionalready worked with this way, soalthough we add a test case to verify this, we don't have to do anything
else.
Fixes #1260.