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