Improve commands page (#198)

* Update console commands docs page

* Remove --with-pending mentions

* Improve commands page
This commit is contained in:
lukinovec 2022-09-02 17:43:04 +02:00 committed by GitHub
parent 4425a71556
commit b8d7466496
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,28 +9,28 @@ section: content
The package comes with some useful artisan commands.
## **Migrate** {#migrate}
Tenant-aware commands run for all tenants by default. The commands also have the `--tenants` option which lets you specify IDs of the tenants for which the command will run.
The most important command. To use tenants, you have to be able to migrate their databases.
> 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.
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.
## **Migrate** (tenant-aware) {#migrate}
`tenants:migrate` is the most important command. To use tenants, you have to be able to migrate their databases.
```
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` (e.g. use a custom tenant seeder) 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 +40,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 +77,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`.
The tag is derived from `config('tenancy.cache.tag_base') . $id`.