Skip to content

Fix: clean stale migrations when up --baseline has no pending work#16

Merged
rwdaigle merged 1 commit intomainfrom
ryan/baseline-cleanup-skipped
Feb 15, 2026
Merged

Fix: clean stale migrations when up --baseline has no pending work#16
rwdaigle merged 1 commit intomainfrom
ryan/baseline-cleanup-skipped

Conversation

@rwdaigle
Copy link
Contributor

@rwdaigle rwdaigle commented Feb 15, 2026

Summary

  • When migrate up --baseline runs with no pending migrations, stale migration files at or below the existing baseline version are now cleaned up
  • Previously these files were silently ignored because the early return in the "no pending" path skipped baseline cleanup logic
  • This handles the case where old migration files reappear (e.g., via git merge after a baseline was created)

Test plan

  • Added integration test test_up_baseline_cleans_stale_migrations that simulates a stale file reappearing after baseline and verifies cleanup
  • All 50 tests pass (22 unit + 17 fixture + 11 integration)
  • cargo fmt --check && cargo clippy -- -D warnings && cargo build --release all pass
  • Version bumped to 0.5.1 (patch release)

🤖 Generated with Claude Code


Open with Devin

When running `migrate up --baseline` and all migrations are already applied,
stale migration files (e.g. reintroduced via git merge) at or below the
existing baseline version are now deleted. Previously they were silently
ignored because the early return skipped baseline cleanup logic.

Bump version to 0.5.1 for patch release.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

@rwdaigle rwdaigle merged commit f18d017 into main Feb 15, 2026
4 checks passed
@rwdaigle rwdaigle deleted the ryan/baseline-cleanup-skipped branch February 15, 2026 17:08
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.

1 participant