From a0525a82397ac8c028c33a468e551b3e6ae2c85c Mon Sep 17 00:00:00 2001 From: lukinovec Date: Thu, 1 Sep 2022 14:48:49 +0200 Subject: [PATCH] Update console commands docs page --- source/docs/v3/console-commands.blade.md | 26 ++++++++++++++---------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/source/docs/v3/console-commands.blade.md b/source/docs/v3/console-commands.blade.md index 9123f05..5e4a08c 100644 --- a/source/docs/v3/console-commands.blade.md +++ b/source/docs/v3/console-commands.blade.md @@ -9,28 +9,32 @@ section: content 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. -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 ``` -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** {#rollback-and-seed} +## **Rollback & seed** (tenant-aware) {#rollback-and-seed} - Rollback: `tenants:rollback` - 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. @@ -40,7 +44,7 @@ You may use it like this: 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. @@ -77,4 +81,4 @@ You can delete specific tenants' cache by using the `--tags` option on `cache php artisan cache:clear --tags=tenantdbe0b330-1a6e-11e9-b4c3-354da4b4f339 ``` -The tag is derived from `config('tenancy.cache.tag_base') . $id`. \ No newline at end of file +The tag is derived from `config('tenancy.cache.tag_base') . $id`.