mirror of
https://github.com/stancl/tenancy-docs.git
synced 2025-12-12 10:14:03 +00:00
Update console commands docs page
This commit is contained in:
parent
af05970907
commit
a0525a8239
1 changed files with 15 additions and 11 deletions
|
|
@ -9,28 +9,32 @@ section: content
|
||||||
|
|
||||||
The package comes with some useful artisan commands.
|
The package comes with some useful artisan commands.
|
||||||
|
|
||||||
## **Migrate** {#migrate}
|
All tenant-aware commands accept two options:
|
||||||
|
|
||||||
|
- `--tenants` – IDs of the tenants for which the command should run, and if not specified, run the command for all tenants.
|
||||||
|
|
||||||
|
> Note: To include multiple tenants using CLI, you can use multiple `--tenants=<...>` options. If you're calling the command using `Artisan::call()`, `--tenants` has to be an array.
|
||||||
|
|
||||||
|
- `--with-pending` – Specify if the command should also run for the pending tenants // todo@pendingTenantsDocumentation
|
||||||
|
|
||||||
|
## **Migrate** (tenant-aware) {#migrate}
|
||||||
|
|
||||||
The most important command. To use tenants, you have to be able to migrate their databases.
|
The most important command. To use tenants, you have to be able to migrate their databases.
|
||||||
|
|
||||||
You can use the `tenants:migrate` command to migrate tenant's databases. You can also specify which tenants' databases should be migrated using the `--tenants` option.
|
|
||||||
|
|
||||||
```
|
```
|
||||||
php artisan tenants:migrate --tenants=8075a580-1cb8-11e9-8822-49c5d8f8ff23
|
php artisan tenants:migrate --tenants=8075a580-1cb8-11e9-8822-49c5d8f8ff23
|
||||||
```
|
```
|
||||||
|
|
||||||
You may use multiple `--tenants=<...>` options.
|
> Note: By default, the migrations should be in database/migrations/tenant. If you wish to use a different path, you may use the `--path` option. You can also specify the default parameters for the command [in the tenancy config]({{ $page->link('configuration#migration-parameters') }})
|
||||||
|
|
||||||
> Note: By default, the migrations should be in database/migrations/tenant. If you wish to use a different path, you may use the `--path` argument.
|
## **Rollback & seed** (tenant-aware) {#rollback-and-seed}
|
||||||
|
|
||||||
## **Rollback & seed** {#rollback-and-seed}
|
|
||||||
|
|
||||||
- Rollback: `tenants:rollback`
|
- Rollback: `tenants:rollback`
|
||||||
- Seed: `tenants:seed`
|
- Seed: `tenants:seed`
|
||||||
|
|
||||||
Similarly to `migrate`, these commands accept a `--tenants` option.
|
> Note: You can configure the default parameters for `tenants:seed` in [the tenancy config]({{ $page->link('configuration#seeder-parameters') }})
|
||||||
|
|
||||||
## **Migrate fresh** {#migrate-fresh}
|
## **Migrate fresh** (tenant-aware) {#migrate-fresh}
|
||||||
|
|
||||||
This package also offers a simplified, tenant-aware version of `migrate:fresh`. It runs `db:wipe` and `tenants:migrate` on the tenant's database.
|
This package also offers a simplified, tenant-aware version of `migrate:fresh`. It runs `db:wipe` and `tenants:migrate` on the tenant's database.
|
||||||
|
|
||||||
|
|
@ -40,7 +44,7 @@ You may use it like this:
|
||||||
php artisan tenants:migrate-fresh --tenants=8075a580-1cb8-11e9-8822-49c5d8f8ff23
|
php artisan tenants:migrate-fresh --tenants=8075a580-1cb8-11e9-8822-49c5d8f8ff23
|
||||||
```
|
```
|
||||||
|
|
||||||
## **Run** {#run}
|
## **Run** (tenant-aware) {#run}
|
||||||
|
|
||||||
You can use the `tenants:run` command to run your own commands for tenants.
|
You can use the `tenants:run` command to run your own commands for tenants.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue