mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 09:04:04 +00:00
Fix some tests
This commit is contained in:
parent
a632b545b7
commit
1532ccf019
15 changed files with 121 additions and 118 deletions
|
|
@ -51,18 +51,19 @@ class Rollback extends RollbackCommand
|
|||
|
||||
$this->input->setOption('database', 'tenant');
|
||||
|
||||
tenant()->all($this->option('tenants'))->each(function ($tenant) {
|
||||
$this->line("Tenant: {$tenant['id']} ({$tenant['domain']})");
|
||||
$this->database->connectToTenant($tenant);
|
||||
$originalTenant = tenancy()->getTenant();
|
||||
tenancy()->all($this->option('tenants'))->each(function ($tenant) {
|
||||
$this->line("Tenant: {$tenant['id']}");
|
||||
tenancy()->initialize($tenant);
|
||||
|
||||
// Migrate
|
||||
parent::handle();
|
||||
});
|
||||
|
||||
if (tenancy()->initialized) {
|
||||
tenancy()->switchDatabaseConnection();
|
||||
if ($originalTenant) {
|
||||
tenancy()->initialize($originalTenant);
|
||||
} else {
|
||||
$this->database->disconnect();
|
||||
tenancy()->endTenancy();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue