From ede2dc23c6405e949eb340a0c61f5347587a3467 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Fri, 4 Oct 2019 21:22:47 +0200 Subject: [PATCH] Use correct DB connections in Migrate, Rollback & Seed commands --- src/Commands/Migrate.php | 2 +- src/Commands/Rollback.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Commands/Migrate.php b/src/Commands/Migrate.php index b8dc5fa9..bea55c8e 100644 --- a/src/Commands/Migrate.php +++ b/src/Commands/Migrate.php @@ -53,7 +53,7 @@ class Migrate extends MigrateCommand tenancy()->all($this->option('tenants'))->each(function ($tenant) { $this->line("Tenant: {$tenant['id']}"); - $this->input->setOption('database', 'tenant'); + $this->input->setOption('database', $tenant->getDatabaseName()); tenancy()->initialize($tenant); // Migrate diff --git a/src/Commands/Rollback.php b/src/Commands/Rollback.php index f19e5fa4..ed880af6 100644 --- a/src/Commands/Rollback.php +++ b/src/Commands/Rollback.php @@ -49,11 +49,11 @@ class Rollback extends RollbackCommand return; } - $this->input->setOption('database', 'tenant'); - $originalTenant = tenancy()->getTenant(); tenancy()->all($this->option('tenants'))->each(function ($tenant) { $this->line("Tenant: {$tenant['id']}"); + + $this->input->setOption('database', $tenant->getDatabaseName()); tenancy()->initialize($tenant); // Migrate