mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 09:54:03 +00:00
Don't auto migrate new tenants' databases
This commit is contained in:
parent
ac34d0e5b8
commit
19de80582d
2 changed files with 9 additions and 4 deletions
10
README.md
10
README.md
|
|
@ -167,7 +167,15 @@ You can use the `tenancy()` and `tenant()` helpers to resolve `Stancl\Tenancy\Te
|
|||
]
|
||||
```
|
||||
|
||||
When you create a new tenant, [tenant migrations](#tenant-migrations) will automatically be executed for that tenant.
|
||||
When you create a new tenant, you can [migrate](#tenant-migrations) their database like this:
|
||||
|
||||
```php
|
||||
\Artisan::call('tenants:migrate', [
|
||||
'--tenants' => [$tenant['uuid']]
|
||||
]);
|
||||
```
|
||||
|
||||
You can also seed the database in the same way. The only difference is the command name (`tenants:seed`).
|
||||
|
||||
### Starting a session as a tenant
|
||||
|
||||
|
|
|
|||
|
|
@ -79,9 +79,6 @@ class TenantManager
|
|||
|
||||
$tenant = $this->storage->createTenant($domain, \Uuid::generate(1, $domain));
|
||||
$this->database->create($this->getDatabaseName($tenant));
|
||||
\Artisan::call('tenants:migrate', [
|
||||
'--tenants' => [$tenant['uuid']]
|
||||
]);
|
||||
|
||||
return $tenant;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue