Strong Migrations is a Ruby gem that catches unsafe database migrations in development.
The tool addresses the problem of migrations that can cause application downtime or errors by blocking reads and writes, corrupting data, or causing runtime exceptions. It works by detecting potentially dangerous operations before they run and preventing execution by default, while providing guidance on safer alternatives. Operations are classified as dangerous if they block reads or writes for more than a few seconds or have a good chance of causing application errors.
Developers should adopt this tool if they work with Rails applications using PostgreSQL, MySQL, or MariaDB and want to prevent migration-related incidents in production. It suits any team concerned with database safety and zero-downtime deployments. The tool detects a broad range of unsafe patterns including removing columns, changing column types, renaming tables, adding foreign keys, creating indexes non-concurrently, and setting NOT NULL on existing columns. Database-specific checks are provided for PostgreSQL, MySQL, and MariaDB, since each has different locking and rewrite behaviors. The tool allows disabling specific checks or adding custom checks when needed.
The project maintains active engagement with issues and pull requests, showing responsiveness to user feedback and bug reports. Development includes regular updates to detection logic and support for new database features. The codebase demonstrates careful attention to the nuances of different database systems and their migration semantics.