mirror of
https://github.com/archtechx/tenancy.git
synced 2026-06-21 01:54:03 +00:00
1.3 KiB
1.3 KiB
Migrations And Commands Reference
Use this for tenant-aware Artisan operations.
Source Files
src/Commands/*src/Concerns/HasTenantOptions.phpsrc/Concerns/ExtendsLaravelCommand.phpsrc/Concerns/DealsWithMigrations.phpassets/config.php
Tenant Migrations
Defaults from tenancy.migration_parameters:
--forcetrue--pathdatabase/migrations/tenant--schema-pathdatabase/schema/tenant-schema.dump--realpathtrue
Commands:
php artisan tenants:migrate
php artisan tenants:migrate --tenants=tenant-id
php artisan tenants:migrate --skip-failing
php artisan tenants:rollback
php artisan tenants:migrate-fresh
php artisan tenants:seed
Tenant Operations
php artisan tenants:run cache:clear
php artisan tenant:tinker
php artisan tenants:list
php artisan tenant:dump
Maintenance And Storage
php artisan tenants:down
php artisan tenants:up
php artisan tenants:link
php artisan tenants:link --remove
Rules
- Use tenant commands for tenant DBs; normal
migrateis central. - Use
--tenants=*to scope commands to selected tenants. - Use
--skip-failingonly when failures should not stop execution. - Use concurrent process options only after verifying tenant operations are safe in parallel.