mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 16:24:04 +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) {
|
tenancy()->all($this->option('tenants'))->each(function ($tenant) {
|
||||||
$this->line("Tenant: {$tenant['id']}");
|
$this->line("Tenant: {$tenant['id']}");
|
||||||
|
|
||||||
$this->input->setOption('database', 'tenant');
|
$this->input->setOption('database', $tenant->getDatabaseName());
|
||||||
tenancy()->initialize($tenant);
|
tenancy()->initialize($tenant);
|
||||||
|
|
||||||
// Migrate
|
// Migrate
|
||||||
|
|
|
||||||
|
|
@ -49,11 +49,11 @@ class Rollback extends RollbackCommand
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->input->setOption('database', 'tenant');
|
|
||||||
|
|
||||||
$originalTenant = tenancy()->getTenant();
|
$originalTenant = tenancy()->getTenant();
|
||||||
tenancy()->all($this->option('tenants'))->each(function ($tenant) {
|
tenancy()->all($this->option('tenants'))->each(function ($tenant) {
|
||||||
$this->line("Tenant: {$tenant['id']}");
|
$this->line("Tenant: {$tenant['id']}");
|
||||||
|
|
||||||
|
$this->input->setOption('database', $tenant->getDatabaseName());
|
||||||
tenancy()->initialize($tenant);
|
tenancy()->initialize($tenant);
|
||||||
|
|
||||||
// Migrate
|
// Migrate
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue