Announcing online_migrations - a gem that catches unsafe migrations in development and provides helpers to run them easier in production

Hello everyone :wave:

I’m publishing a new gem today. The name is online_migrations, it’s at https://github.com/fatkodima/online_migrations. For those familiar with strong_migrations, it is a strong_migrations on steroids.

It allows to catch unsafe migrations (like adding a column with a default, removing a column, adding an index non-concurrently etc) in development and provides instructions and migrations helpers to run them easily and without downtime in production.

It has migrations helpers for:

  1. renaming tables/columns
  2. changing columns types (including changing primary/foreign keys from integer to bigint)
  3. adding columns with default values
  4. adding different types of constraints
  5. and others

Additionally, it has an internal framework for running data migrations on very large tables using background migrations. For example, you can use background migrations to migrate data that’s stored in a single JSON column to a separate table instead; backfill values from one column to another (as one of the steps when changing column type); or backfill some column’s value from an API.

It supports ruby 2.1+, rails 4.2+ and PostgreSQL 9.6+.

Released a new version - online_migrations/CHANGELOG.md at master · fatkodima/online_migrations · GitHub with support for configuring multiple databases and 3 new checks. :tada:

Give it a try!

Released a new version - online_migrations/CHANGELOG.md at master · fatkodima/online_migrations · GitHub with more safe/unsafe changing column type checks and ability to reset counter caches using background migrations.