Skip to content

Artisan migrate:refresh should not run without warning even in app_env=DEV #53801

Answered by rojtjo
ataldev asked this question in General
Discussion options

You must be logged in to vote

You could mark the commands as prohibited, but that would prevent you from running them all together.

use Illuminate\Database\Console\Migrations\RefreshCommand;
use Illuminate\Support\Facades\DB;

// Prevent destructive DB commands
Illuminate\Support\Facades\DB::prohibitDestructiveCommands(true);

// Or just the `migrate:refresh` command
RefreshCommand::prohibit(true);

See #51376

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@ataldev
Comment options

Answer selected by ataldev
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants