Workflow Code Review

Review Database Migration

Review workflow for database migration safety

reviewdatabasemigration
CLAUDE.md

When reviewing a database migration:

  1. Check that the migration is reversible — there should be a down/rollback migration.
  2. Check for data loss: does the migration drop columns or tables that contain production data?
  3. Check for locking: will the migration lock a large table for an extended period? (ALTER TABLE on big tables can be dangerous.)
  4. Check that default values are set for new NOT NULL columns on existing tables.
  5. Verify the migration works on an empty database and on a database with existing data.
  6. Check that ORM models and types are updated to match the schema change.
  7. If the migration is large or risky, verify there’s a tested rollback plan.

Copy this workflow into your CLAUDE.md or agent config file so your agent follows this process automatically.

get crystl