Set a lock_timeout, split steps, and add columns nullable-then-backfill to keep migration locks short.
Why This Matters
Migrations that take and hold strong locks while doing heavy work stall every query behind them and can take production down.
Related Rules
Catch this automatically on every PR
BeforeMerge scans your pull requests against this rule and dozens more. Get actionable feedback before code ships.