Skip to content

feat(cli): add migration:log and migration:unlog commands#7347

Merged
B4nan merged 4 commits intomikro-orm:nextfrom
eyupcanakman:feat/migration-log-unlog-5390
Apr 18, 2026
Merged

feat(cli): add migration:log and migration:unlog commands#7347
B4nan merged 4 commits intomikro-orm:nextfrom
eyupcanakman:feat/migration-log-unlog-5390

Conversation

@eyupcanakman
Copy link
Copy Markdown

Summary

  • Add migration:log and migration:unlog CLI commands
  • migration:log marks a migration as executed without running it
  • migration:unlog removes it from the executed list without reverting
  • Add entries to the migrations documentation

Closes #5390

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.64%. Comparing base (6e4fe2a) to head (69a0b73).
⚠️ Report is 95 commits behind head on next.

Additional details and impacted files
@@           Coverage Diff            @@
##             next    #7347    +/-   ##
========================================
  Coverage   99.64%   99.64%            
========================================
  Files         262      262            
  Lines       25931    25953    +22     
  Branches     6696     7149   +453     
========================================
+ Hits        25840    25862    +22     
  Misses         85       85            
  Partials        6        6            

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@B4nan
Copy link
Copy Markdown
Member

B4nan commented Mar 20, 2026

Please update the snapshots.

@eyupcanakman
Copy link
Copy Markdown
Author

@B4nan thanks for the fixes.

eyupcanakman and others added 3 commits March 21, 2026 21:30
Add two new CLI commands for manual migration bookkeeping:

- `migration:log` marks a migration as executed without running it
- `migration:unlog` removes a migration from the executed list without
  reverting it

These use the existing `Migrator.logMigration()` and
`Migrator.unlogMigration()` methods exposed via the MigrationRunner.

Closes mikro-orm#5390
…on:unlog

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…e directly

Add logMigration/unlogMigration to IMigrator interface and
AbstractMigrator so the CLI doesn't bypass the migrator layer by
reaching into the @internal getStorage(). Also tighten close() assertion
in tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@eyupcanakman eyupcanakman force-pushed the feat/migration-log-unlog-5390 branch from dd6d7f2 to 30de23e Compare March 21, 2026 18:34
@B4nan
Copy link
Copy Markdown
Member

B4nan commented Mar 21, 2026

Looks like you just overridden my fixes, the snapshot updates are gone...

edit: or maybe it wasnt about snapshots? lets see what the tests will say :]

@eyupcanakman
Copy link
Copy Markdown
Author

Sorry about the force push. I rebased onto latest master but your two commits are in the branch history. CI is green now.

@B4nan B4nan changed the base branch from master to next April 18, 2026 14:01
@B4nan B4nan changed the title feat(cli): add migration:log and migration:unlog commands feat(cli): add migration:log and migration:unlog commands Apr 18, 2026
@B4nan B4nan merged commit d4dc516 into mikro-orm:next Apr 18, 2026
22 checks passed
B4nan added a commit that referenced this pull request Apr 19, 2026
## Summary
- Add `migration:log` and `migration:unlog` CLI commands
- `migration:log` marks a migration as executed without running it
- `migration:unlog` removes it from the executed list without reverting
- Add entries to the migrations documentation

Closes #5390

---------

Co-authored-by: Martin Adámek <banan23@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
B4nan added a commit that referenced this pull request Apr 20, 2026
## Summary
- Add `migration:log` and `migration:unlog` CLI commands
- `migration:log` marks a migration as executed without running it
- `migration:unlog` removes it from the executed list without reverting
- Add entries to the migrations documentation

Closes #5390

---------

Co-authored-by: Martin Adámek <banan23@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

Feat: Ability to add migrations without actually running it

2 participants