Skip to content

Migration Commands ​

Run Modularous-aware migrations. These wrap Laravel's migration commands with awareness of module directories — they scan modules/*/Database/Migrations/ in addition to the host app's database/migrations/.

CommandSignatureDescription
migratemodularous:migrateRun all module migrations
migrate:refreshmodularous:migrate:refreshRollback and re-run all module migrations
migrate:rollbackmodularous:migrate:rollbackRollback the last batch of module migrations

Common Workflows ​

Apply new migrations during development ​

bash
php artisan modularous:migrate

Runs any unmigrated files across all modules. Safe to re-run; already-applied migrations are skipped.

Reset and re-seed a local database ​

bash
php artisan modularous:migrate:refresh
php artisan db:seed

Rolls back everything and migrates fresh. Never use on production — this drops data. Prefer migrate:rollback for targeted undo.

Revert a mistake ​

bash
php artisan modularous:migrate:rollback

Rolls back the last batch of migrations. Run repeatedly to roll back further batches.

  • Upgrading — migrations play a central role in version upgrades
  • Sync / sync:states — keep enum-backed state columns in sync after migrations
  • check-collation — verify database collation settings