mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 05:44:04 +00:00
Rewrite old tests
This commit is contained in:
parent
64383b4c56
commit
89936187ce
71 changed files with 698 additions and 3203 deletions
|
|
@ -57,20 +57,13 @@ class Migrate extends MigrateCommand
|
|||
return;
|
||||
}
|
||||
|
||||
tenancy()
|
||||
->query()
|
||||
->when($this->option('tenants'), function ($query) {
|
||||
$query->whereIn(tenancy()->model()->getTenantKeyName(), $this->option('tenants'));
|
||||
})
|
||||
->each(function (TenantWithDatabase $tenant) {
|
||||
$this->line("Tenant: {$tenant['id']}");
|
||||
tenancy()->runForMultiple($this->option('tenants'), function ($tenant) {
|
||||
$this->line("Tenant: {$tenant['id']}");
|
||||
|
||||
// Migrate
|
||||
parent::handle();
|
||||
|
||||
$tenant->run(function () {
|
||||
// Migrate
|
||||
parent::handle();
|
||||
});
|
||||
|
||||
event(new DatabaseMigrated($tenant));
|
||||
});
|
||||
event(new DatabaseMigrated($tenant));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue