[10.x] Add php artisan migrate:redo
command
#49615
Closed
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.
A lot of developers (myself included) often have to rollback and re-run the newly-created migration because we had a last-second decision that we need to add another column, or change the column structure.
I know that there is an option to do
php artisan migrate:refresh --step=1
- but the command often needs an additional alias due to its length - because most of the time we don't need to refresh all the migrations (as it does with no parameters), but only the recent one.So, such command would help us save the time developing and quickly editing new migrations !
Just in case, it also accepts ``--step` parameter, which defaults to 1 but can be set to any number.