Generate database or code migration scripts. Use when the user says /migration, asks to create a migration, add a database column, change a schema, migrate data, or refactor code across a codebase. Triggers: migration, migrate, schema change, add column, alter table, database migration, data migration, code migration, upgrade path.
Generate safe, reversible migration scripts for databases and code.
Detect the migration framework:
prisma/schema.prisma, drizzle/, migrations/, alembic/, db/migrate/, etc.Understand the change:
Generate the migration:
npx prisma migrate dev, rails generate migration).Safety checks:
Generate a migration plan for complex changes:
Step 1: Add new nullable column (no downtime)
Step 2: Backfill data (background job)
Step 3: Update application code to write to new column
Step 4: Add NOT NULL constraint
Step 5: Remove old column (next release)
add_email_verified_to_users, not migration_042.