1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-04 12:14:04 +00:00

Reset template connection regardless of process count

This commit is contained in:
Samuel Štancl 2025-08-25 15:49:38 +02:00
parent ae9b91d62e
commit 916316f1e8

View file

@ -58,12 +58,12 @@ class Migrate extends MigrateCommand
} }
if ($this->getProcesses() > 1) { if ($this->getProcesses() > 1) {
return $this->runConcurrently($this->getTenantChunks()->map(function ($chunk) { $code = $this->runConcurrently($this->getTenantChunks()->map(function ($chunk) {
return $this->getTenants($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 // Reset the template tenant connection to the original one
config(['tenancy.database.template_tenant_connection' => $originalTemplateConnection]); config(['tenancy.database.template_tenant_connection' => $originalTemplateConnection]);