From 19de80582d67105e8282522aae778f088b3c48a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Sun, 20 Jan 2019 20:02:13 +0100 Subject: [PATCH] Don't auto migrate new tenants' databases --- README.md | 10 +++++++++- src/TenantManager.php | 3 --- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index eec67863..98f0d855 100644 --- a/README.md +++ b/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 diff --git a/src/TenantManager.php b/src/TenantManager.php index f4af0c77..2d654088 100644 --- a/src/TenantManager.php +++ b/src/TenantManager.php @@ -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; }