From 2d5ac488e47c2fa4dea0c7f4b2d4a6d6e10f7ba1 Mon Sep 17 00:00:00 2001 From: Isaiah Paget Date: Sun, 8 Jun 2025 12:46:15 -0700 Subject: [PATCH 1/5] fix added support for --force option when migration the database --- modules/system/console/WinterUp.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/system/console/WinterUp.php b/modules/system/console/WinterUp.php index 1b54d1d534..20355a0f9d 100644 --- a/modules/system/console/WinterUp.php +++ b/modules/system/console/WinterUp.php @@ -1,6 +1,9 @@ -confirmToProceed()) { + return 1; + } + $this->output->writeln('Migrating application and plugins...'); UpdateManager::instance() From b35f701008abe65cc984723a403c846934c9aa30 Mon Sep 17 00:00:00 2001 From: Luke Towers Date: Tue, 10 Jun 2025 01:16:35 -0600 Subject: [PATCH 2/5] Update modules/system/console/WinterUp.php --- modules/system/console/WinterUp.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/console/WinterUp.php b/modules/system/console/WinterUp.php index 20355a0f9d..bd3037cdec 100644 --- a/modules/system/console/WinterUp.php +++ b/modules/system/console/WinterUp.php @@ -25,7 +25,7 @@ class WinterUp extends Command implements Isolatable */ protected $signature = 'winter:up {--seed : Included for compatibility with Laravel default signature, no effect at this time} - {--force : Included for compatibility with Laravel default signature, force the operation to run when in production} + {--force : Force the operation to run when in production} '; /** From 3458dd79869853122db02b71361a8a65052281e6 Mon Sep 17 00:00:00 2001 From: Luke Towers Date: Tue, 10 Jun 2025 01:16:48 -0600 Subject: [PATCH 3/5] Update modules/system/console/WinterUp.php --- modules/system/console/WinterUp.php | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/system/console/WinterUp.php b/modules/system/console/WinterUp.php index bd3037cdec..438fef2b82 100644 --- a/modules/system/console/WinterUp.php +++ b/modules/system/console/WinterUp.php @@ -18,6 +18,7 @@ class WinterUp extends Command implements Isolatable { use ConfirmableTrait; + /** * The name and signature of the console command. * From 7dcb5babade0fcf73fedabb1d694f599c045fde6 Mon Sep 17 00:00:00 2001 From: Luke Towers Date: Tue, 10 Jun 2025 01:17:18 -0600 Subject: [PATCH 4/5] Update modules/system/console/WinterUp.php --- modules/system/console/WinterUp.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/system/console/WinterUp.php b/modules/system/console/WinterUp.php index 438fef2b82..a01c5b7fa7 100644 --- a/modules/system/console/WinterUp.php +++ b/modules/system/console/WinterUp.php @@ -50,7 +50,7 @@ public function __construct() */ public function handle() { - if (! $this->confirmToProceed()) { + if (!$this->confirmToProceed()) { return 1; } From a5800d73e3e456179e00f9aa48ea93d83b9424a1 Mon Sep 17 00:00:00 2001 From: Isaiah Paget Date: Tue, 24 Jun 2025 22:49:22 -0700 Subject: [PATCH 5/5] Adds support for additional configuration so that the need to use --force in production when migratin the database is an optional flag and not enabled by default. I went with a new 'console' table in database.php because the code in Storm doesn't like it when 'migrations' isn't a string. --- config/database.php | 14 ++++++++++++++ modules/system/console/WinterUp.php | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/config/database.php b/config/database.php index f57e26acac..7421f5f8ea 100644 --- a/config/database.php +++ b/config/database.php @@ -98,6 +98,20 @@ 'migrations' => 'migrations', + /* + |-------------------------------------------------------------------------- + | Console Configuration Table + |-------------------------------------------------------------------------- + | + | This table controls the configurable behavior of the console as + | as it relates to the database and migrations. + | + */ + + 'console' => [ + 'confirm_in_prod' => env('MIGRATION_CONFIRM_IN_PROD', false), + ], + /* |-------------------------------------------------------------------------- | Redis Databases diff --git a/modules/system/console/WinterUp.php b/modules/system/console/WinterUp.php index a01c5b7fa7..b7d79bf678 100644 --- a/modules/system/console/WinterUp.php +++ b/modules/system/console/WinterUp.php @@ -50,7 +50,7 @@ public function __construct() */ public function handle() { - if (!$this->confirmToProceed()) { + if (config('database.console.confirm_in_prod', false) && !$this->confirmToProceed()) { return 1; }