Skip to content

Conversation

@hexathos
Copy link
Contributor

This PR prevents the destructive RollbackCommand if DB::prohibitDestructiveCommands is set to true.

…Command

Signed-off-by: Rainer Bendig <hexathos@gmail.com>
@hexathos hexathos marked this pull request as draft January 17, 2025 23:02
Signed-off-by: Rainer Bendig <hexathos@gmail.com>
@hexathos hexathos marked this pull request as ready for review January 17, 2025 23:06
@taylorotwell taylorotwell merged commit fffdd53 into laravel:11.x Jan 18, 2025
38 checks passed
@alexkart
Copy link

alexkart commented Jan 29, 2025

@hexathos What is the reason to prohibit rollback command? While other ones understandably never should be run in production the rollback command sometimes needs to be run to rollback the latest changes if they introduce a bug, for example, and it is not always destructive.

@MrPunyapal
Copy link
Contributor

@alexkart

You may do this to avoid it if you want!

DB::prohibitDestructiveCommands();
RollbackCommand::prohibit(false);

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.

4 participants