rails-antipattern-migration-smells
Installation
SKILL.md
Antipattern: Migration Smells
The smells
- Referencing app models (
User.find_each ...) — the model schema today is not the schema at migration time - Irreversible
changeblocks doingexecute "UPDATE ..."or destructive transforms - Schema + data in the same migration — long
UPDATEs during a deploy lock tables - Missing indexes on foreign keys — joins get slower as data grows
- No
null: false/ default onadd_columnfor required fields, leading to a follow-up "fix" migration
Why it hurts
- Fresh-environment setup (CI, new dev machine) becomes fragile as the model evolves
- Production deploys lock tables for minutes
- Rollbacks are impossible
- Joins on un-indexed FKs slow down at scale