Repository navigation
[13.x] Don't report skipped migrations as pending in migrate:status - #61989
Merged
taylorotwell merged 6 commits intoOct 15, 2026
Merged
Conversation
|
Thanks for submitting a PR! Note that draft PRs are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface. Pull requests that are abandoned in draft may be closed due to inactivity. |
jackbayliss
marked this pull request as ready for review
October 15, 2026 13:29
Contributor
|
Glad to see this get merged. I tried twice in a previous release to add the exact same thing. |
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.
We can use shouldRun() in migrations, but when it returns false (ie a feature isn't enabled), migrate:status still shows the migration as pending despite knowing it aint gonna run.
This PR shows migrations where shouldRun() returns false as Skipped (same as the migrate command), so --pending only counts migrations that will actually run.
Since shouldRun() could depend on an earlier pending migration (ie checking a table it creates exists), once we hit a migration that will actually run, everything after it shows as Pending like today.
Sooo, I think this covers the flaws I can think of - I've also added tests for the command as I couldn't see any.
So before:

but, its ofc skipped

after: This labels it as skipped, as we run status before migrate..

So migrate:status --pending never comes back clean, which is a pain if you use it to check if there's actually anything to migrate.
Many deployment scripts do something like
$this->callSilently(StatusCommand::class, ['--pending' => 100]) === 100to decide whether to go into maintenance mode. Right now those apps go down for migrations that are just going to be skipped anyway.Happy for it to go in the bin if you're not sold, but had to try.