Fix up migration targeting an applied version - #1403
Merged
Merged
Conversation
brandur
approved these changes
Sep 28, 2026
bgentry
force-pushed
the
bg/fix-migrate-up-applied-target
branch
from
September 28, 2026 15:29
9587247 to
ded1716
Compare
Up migrations can have newer versions pending when the requested target is already applied. In that case, leaving the pending list intact applies those newer migrations despite the requested target. Track whether the target appears in the pending list before `MaxSteps` trims it. Return an empty list for an applied up target while preserving the existing step limit behavior for a pending target beyond the limit. Clarify the option documentation and record the behavior change. Cover targets below and equal to the current version with a newer migration pending, the step limit interaction, and the CLI path.
bgentry
force-pushed
the
bg/fix-migrate-up-applied-target
branch
from
September 28, 2026 15:36
ded1716 to
ec78a2c
Compare
bgentry
marked this pull request as ready for review
September 28, 2026 15:36
bgentry
enabled auto-merge (squash)
September 28, 2026 15:36
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.
An up migration targeting an already-applied version could apply later pending migrations. Preserve whether the target was pending before
MaxStepstrims the list, then return an empty result when the target was already applied. A pending target beyondMaxStepskeeps its existing step-limited behavior.Clarify the
TargetVersiondocumentation and changelog, and cover targets below and equal to the current version, theMaxStepsinteraction, and themigrate-up --target-versionCLI path.