mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 11:34:03 +00:00
Use correct DB connections in Migrate, Rollback & Seed commands
This commit is contained in:
parent
d4472469f0
commit
ede2dc23c6
2 changed files with 3 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue