mirror of
https://github.com/stancl/tenancy-docs.git
synced 2025-12-12 10:14:03 +00:00
customizing migration paths
This commit is contained in:
parent
760a6fd95d
commit
272de8b085
1 changed files with 5 additions and 1 deletions
|
|
@ -9,3 +9,7 @@ section: content
|
||||||
Move your tenant migrations to the `database/migrations/tenant` directory. You can execute them using `php artisan tenants:migrate`.
|
Move your tenant migrations to the `database/migrations/tenant` directory. You can execute them using `php artisan tenants:migrate`.
|
||||||
|
|
||||||
Note that all migrations share the same PHP namespace, so even if you use the same table name in the central and tenant databases, you have to use different migration (class) names.
|
Note that all migrations share the same PHP namespace, so even if you use the same table name in the central and tenant databases, you have to use different migration (class) names.
|
||||||
|
|
||||||
|
If you use a modular approach to developing your project, you may have tenant migrations in multiple places. Luckily, you can specify where the package should look for tenant migrations. The `database/migrations/tenant` directory is just the default.
|
||||||
|
|
||||||
|
To set these paths, go to your `config/tenancy.php` file and change the value of the [`--paths` parameter in `migration_parameters`](https://github.com/stancl/tenancy/blob/f2a3cf028ce68e2d55c26751af0bd5a447269894/assets/config.php#L177). You may specify any number of paths in that array.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue