From 916316f1e8ea8c66ec137e41641d967307f6d353 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Mon, 25 Aug 2025 15:49:38 +0200 Subject: [PATCH] Reset template connection regardless of process count --- src/Commands/Migrate.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Commands/Migrate.php b/src/Commands/Migrate.php index 34cd09bf..6ecd6e14 100644 --- a/src/Commands/Migrate.php +++ b/src/Commands/Migrate.php @@ -58,13 +58,13 @@ class Migrate extends MigrateCommand } if ($this->getProcesses() > 1) { - return $this->runConcurrently($this->getTenantChunks()->map(function ($chunk) { + $code = $this->runConcurrently($this->getTenantChunks()->map(function ($chunk) { return $this->getTenants($chunk); })); + } else { + $code = $this->migrateTenants($this->getTenants()) ? 0 : 1; } - $code = $this->migrateTenants($this->getTenants()) ? 0 : 1; - // Reset the template tenant connection to the original one config(['tenancy.database.template_tenant_connection' => $originalTemplateConnection]);