finds.dev

LendingHome/zero_downtime_migrations

Zero downtime migrations with ActiveRecord 3+ and PostgreSQL

View on GitHub

★ 556RubyMITupdated Aug 2023

// the take

A Rails migration linter that raises an exception at dev/test time when a migration would lock a Postgres table under load: adding a column with a default, a non-concurrent index, mixing DDL and data changes in one transaction, or looping with `each` instead of `find_each`. Aimed at Rails teams on Postgres who've been burned by a migration taking down writes in production.

Catches the actual footguns that cause production incidents, not just style issues - add_column-with-default and non-concurrent indexes are the two most common ways people accidentally lock a table. Each check lives in its own class under lib/zero_downtime_migrations/validation, so it's easy to read exactly what triggers a failure. The safety_assured escape hatch (block, method call, or ENV var) means it doesn't become a blocker when you genuinely know what you're doing.

The README's own TODO list admits it doesn't check column type changes, column removal, column renames, or table renames - all classic lock-the-table operations, and all things its direct competitor strong_migrations already covers. No commits since August 2023, while strong_migrations has kept adding checks and Postgres-version-specific behavior in that time, so this is the stalled alternative in a space where the other option is actively maintained. Postgres-only: if your team runs MySQL anywhere, this does nothing for you. The README examples still use pre-Rails-5 migration class syntax, which makes it unclear how well it's been exercised against newer ActiveRecord internals.

We read the README, the directory tree and a key source file in November 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
556
Forks
25
Language
Ruby
License
MIT
Last commit
24 Aug 2023

// nearby

If zero_downtime_migrations isn't quite it.

All repos →