1
0
Fork 0
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:
Samuel Štancl 2019-01-20 20:02:13 +01:00
parent ac34d0e5b8
commit 19de80582d
2 changed files with 9 additions and 4 deletions

View file

@ -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

View file

@ -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;
}