Migration Commands
Migration Commands
Section titled “Migration Commands”Commands to manage tenant migrations.
tenant:migrate
Section titled “tenant:migrate”Runs migrations for a specific tenant.
# Interactive modephp artisan tenant:migrate
# Specific tenantphp artisan tenant:migrate my-tenant
# With seedersphp artisan tenant:migrate my-tenant --seed
# Force in productionphp artisan tenant:migrate my-tenant --forceOptions
Section titled “Options”--path=PATH- Specific migration path--force- Force migration in production--seed- Run seeders after migration--step- Force step-by-step migration
tenant:rollback
Section titled “tenant:rollback”Rolls back migrations for a specific tenant.
# Interactive modephp artisan tenant:rollback
# Rollback last migrationphp artisan tenant:rollback my-tenant
# Rollback last 3 migrationsphp artisan tenant:rollback my-tenant --step=3
# Rollback to specific batchphp artisan tenant:rollback my-tenant --batch=5Options
Section titled “Options”--step=N- Number of migrations to rollback--batch=N- Rollback to specific batch--force- Force rollback in production
tenant:fresh
Section titled “tenant:fresh”Drops all tables and re-runs migrations.
# Interactive modephp artisan tenant:fresh
# Complete resetphp artisan tenant:fresh my-tenant
# With seedersphp artisan tenant:fresh my-tenant --seed
# Force in productionphp artisan tenant:fresh my-tenant --forceOptions
Section titled “Options”--seed- Run seeders after migration--force- Force operation in production--drop-views- Drop all views--drop-types- Drop custom types (PostgreSQL)