Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.x] Add php artisan migrate:redo command #49615

Closed
wants to merge 2 commits into from
Closed

Conversation

hrsa
Copy link
Contributor

@hrsa hrsa commented Jan 8, 2024

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.

@driesvints
Copy link
Member

Why don't you use php artisan migrate:fresh?

@hrsa hrsa closed this Jan 8, 2024
@hrsa hrsa reopened this Jan 8, 2024
@hrsa
Copy link
Contributor Author

hrsa commented Jan 8, 2024

@driesvints i updated the code and the reason to include the command!

@taylorotwell
Copy link
Member

Thanks for your pull request to Laravel!

Unfortunately, I'm going to delay merging this code for now. To preserve our ability to adequately maintain the framework, we need to be very careful regarding the amount of code we include.

If possible, please consider releasing your code as a package so that the community can still take advantage of your contributions!

If you feel absolutely certain that this code corrects a bug in the framework, please "@" mention me in a follow-up comment with further explanation so that GitHub will send me a notification of your response.

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.

3 participants