Review a code change for schema dump drift, swapped ID or enum mappings, irreversible migrations, missing backfills, deploy-window breaks, orphaned references, broken dual-writes, missing transactions, unsafe hot-table indexes, silent data loss, and missing post-deploy verification. Use when reviewing database migrations, schema changes, or data backfills.
75
94%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Review a migration or schema change for what happens in the deploy window: old code on the new schema, new code on old data, and partial failures that leave inconsistent state.
db/schema.rb or db/structure.sql that no migration in this change explains, usually carried in from another branch. The dump's version stamp should match the change's newest migration.1 => TypeA, 2 => TypeB in code when production has the reverse. Check each CASE or IF branch and constant hash entry individually.down that is missing or does not restore.NOT NULL column without a default or backfill fails on existing rows.includes or joins.text to varchar(n) truncation, float to integer precision loss.When a schema dump is in the change, check drift first. Diff the dump and db/migrate/ against the review's base ref, never an assumed main, and cross-reference every dump change against the migrations in this change.
Then check migration correctness, then verification and rollback. Do not trust fixtures; production data shapes differ.
Report destructive DDL, NOT NULL without backfill, drift with no matching migration, swapped mappings, and orphaned references you can name. Report data impact inferred from application code without visible migration handling only when it is severe.
Do not report nullable column additions, new tables with defaults, indexes on new or small tables, test fixtures, seeds or test database setup, or purely additive schema that does not touch existing rows. Do not check drift when no schema dump is in the change.
git checkout <base> -- db/schema.rb) and rerun bin/rails db:migrate.caafac3
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.