create-database-migration
Installation
SKILL.md
Create Database Migration
When To Use
Use this skill when designing schemas, creating new Eloquent model backing tables, adding indexes, or modifying existing database columns.
Workflow
- Verify conventions: Inspect nearby migration files to ensure naming compatibility.
- Scaffold migration: Run
php artisan make:migration create_xxx_table. - Define constraints: Declare explicit relationships, types, indexes, and unique attributes.
- Define down operation: Ensure the migration is reversible (implement
down()properly dropping added columns or tables). - Dry run checks: Run local migrations and rollbacks to verify structural success.