Check file is loaded before trying to rollback it #19922
Merged
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.
I have some migrations on separated folders, and i want to migrate / reset them separately...
Right now it's working great with migrate, but not for reset, when i do:
It works great, but when i do:
It tries to reset all ran migrations, instead of resetting only the loaded files on
special/path
.My PR fixes it, and probably won't make any difference for most use cases.
Even with my PR, there is still another known issue, if you run reset and nothing was migrated, no output is printed... This is basically because here: https://github.com/laravel/framework/blob/5.4/src/Illuminate/Database/Migrations/Migrator.php#L272-L280
$migrations
has all ran migrations, and we do the check with loaded file later.I think totally come with another PR properly fixing it but it will require a more code changes.
Let me know your thoughts so i can work on the other PR.