A Ruby gem that catches unsafe database migrations in development for PostgreSQL, MySQL, and MariaDB.
Strong Migrations is a Ruby gem that helps developers write safer database migrations by detecting potentially dangerous operations before they reach production. It catches issues like removing columns, changing column types, or adding indexes non-concurrently, which can cause downtime or application errors. The gem provides actionable alternatives and enforces safety unless explicitly overridden.
Rails developers and teams working with PostgreSQL, MySQL, or MariaDB databases who need to manage schema changes without causing production downtime or errors.
Developers choose Strong Migrations because it proactively prevents migration-related outages, educates on best practices, and supports multiple databases with minimal configuration. Its battle-tested reliability from use at scale (like Instacart) adds confidence.
Catch unsafe migrations in development
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Detects a wide range of dangerous operations like removing columns, changing types, and adding indexes non-concurrently, with database-specific rules for PostgreSQL, MySQL, and MariaDB, as detailed in the README's checks section.
Provides clear error messages with safer alternatives for each issue, such as step-by-step instructions for renaming columns or tables without downtime, helping developers learn best practices.
Allows adding custom checks or disabling specific ones via configuration, and supports safe-by-default options for common operations like adding indexes, adapting to project needs.
Used at scale by companies like Instacart, ensuring robustness in production environments, as highlighted in the README's battle-tested note.
Cannot inspect or ensure safety for raw SQL statements (e.g., with execute), requiring manual assurance via safety_assured blocks, which can be error-prone if developers overlook risks.
For certain operations like adding exclusion constraints in Postgres or check constraints in MySQL, the README admits safe methods aren't provided and relies on community input, leaving gaps.
Requires setting up timeouts, initializers, and potentially adjusting for target database versions, adding complexity compared to zero-configuration alternatives.