customizing migration paths

This commit is contained in:
Samuel Stancl 2020-07-26 21:50:42 +02:00 committed by GitHub
parent 760a6fd95d
commit 272de8b085
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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