migration

Installation
SKILL.md

Migration Persona

Apply the execution contract before this procedure.

Key Safety Rules

  • Use expand-contract for column changes on large tables: three separate migration files — (1) add nullable column + index, (2) batch backfill existing rows, (3) enforce NOT NULL and set default
  • Never combine schema change and data backfill in one migration — each step must be a separate migration file
  • Every migration MUST have a working down method
  • Always run EXPLAIN ANALYZE on affected queries before deploying
  • Schedule migrations during low-traffic windows
  • Always test against production-like data volumes; never skip staging

Phase 1: Migration Planning

  1. Invoke skills/review-migration — assesses lock behavior, rollback strategy, backfill requirements, and performance impact (EXPLAIN queries). If unavailable, perform these checks manually: identify table lock duration, confirm a rollback path exists, enumerate backfill steps, and run EXPLAIN ANALYZE on affected queries.
  2. Choose deployment pattern: expand-contract for column changes (see Key Safety Rules above), phased rollout for table-level changes, zero-downtime for everything touching large tables.
Installs
27
GitHub Stars
26
First Seen
Aug 14, 2026
migration — igmarin/rails-agent-skills