Skip to content

Fix up migration targeting an applied version - #1403

Merged
bgentry merged 1 commit into
masterfrom
bg/fix-migrate-up-applied-target
Sep 28, 2026
Merged

bgentry merged 1 commit into
masterfrom
bg/fix-migrate-up-applied-target

Conversation

@bgentry

@bgentry bgentry commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

An up migration targeting an already-applied version could apply later pending migrations. Preserve whether the target was pending before MaxSteps trims the list, then return an empty result when the target was already applied. A pending target beyond MaxSteps keeps its existing step-limited behavior.

Clarify the TargetVersion documentation and changelog, and cover targets below and equal to the current version, the MaxSteps interaction, and the migrate-up --target-version CLI path.

Comment thread CHANGELOG.md Outdated
@bgentry
bgentry force-pushed the bg/fix-migrate-up-applied-target branch from 9587247 to ded1716 Compare September 28, 2026 15:29
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
bgentry force-pushed the bg/fix-migrate-up-applied-target branch from ded1716 to ec78a2c Compare September 28, 2026 15:36
@bgentry
bgentry marked this pull request as ready for review September 28, 2026 15:36
@bgentry
bgentry enabled auto-merge (squash) September 28, 2026 15:36
@bgentry
bgentry merged commit eadcf06 into master Sep 28, 2026
15 checks passed
@bgentry
bgentry deleted the bg/fix-migrate-up-applied-target branch September 28, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants