1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 17:24:03 +00:00

Add Tenant migrations section

This commit is contained in:
Samuel Štancl 2019-01-19 11:43:36 +01:00 committed by GitHub
parent 893f664934
commit 9b521f6487
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -164,6 +164,8 @@ 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.
### Starting a session as a tenant ### Starting a session as a tenant
This runs `TenantManager::bootstrap()` which switches the DB connection, prefixes Redis, changes filesystem root paths, etc. This runs `TenantManager::bootstrap()` which switches the DB connection, prefixes Redis, changes filesystem root paths, etc.
@ -357,6 +359,10 @@ Listing all tenants.
- You may specify the tenant(s) UUIDs using the `--tenants` option. - You may specify the tenant(s) UUIDs using the `--tenants` option.
### Tenant migrations
Tenant migrations are located in `database/migrations/tenant`, so you should move your tenant migrations there.
## Some tips ## Some tips
- If you create a tenant using the interactive console (`artisan tinker`) and use sqlite, you might need to change the database's permissions and/or ownership (`chmod`/`chown`) so that the web application can access it. - If you create a tenant using the interactive console (`artisan tinker`) and use sqlite, you might need to change the database's permissions and/or ownership (`chmod`/`chown`) so that the web application can access it.