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 change blocks doing execute "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 on add_column for 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
Installs
2
First Seen
May 8, 2026
rails-antipattern-migration-smells — gierd-inc/dev-skills