Why this matters
Unsafe migrations are a common cause of production outages and deploy rollbacks.
Review SQL/database migrations for operations that can lock large tables or cause downtime. Examples: creating indexes without CONCURRENTLY (Postgres), ALTER COLUMN TYPE on big tables, adding NOT NULL without backfill, long-running updates without batching. Require an online migration strategy (CONCURRENTLY, backfill in batches, dual-write/expand-contract) and a rollback plan.
Unsafe migrations are a common cause of production outages and deploy rollbacks.
Side-by-side examples engineers can pattern-match during review.
CREATE INDEX idx_events_org ON events(org_id); // blocks writes on large tableCREATE INDEX CONCURRENTLY idx_events_org ON events(org_id);
-- plus staged backfill and safe deploy planCREATE INDEX idx_x ON big_table(col);CREATE INDEX CONCURRENTLY idx_x ON big_table(col);From the same buckets as this rule.