How does Rails handle out of order migrations (when working on different local branches)

This page summarizes the projects mentioned and recommended in the original post on /r/rails

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • actual_db_schema

    Wipe out inconsistent DB and schema.rb when switching branches. Just install this gem and use the standard rake db:migrate command.

  • https://github.com/widefix/actual_db_schema gem automatically runs migration/rollback on your current branch. You need to write reversible migrations always though.

  • strong_migrations

    Catch unsafe migrations in development

  • There’s no real way to test, but you can use gems like https://github.com/ankane/strong_migrations and not allow to merge branches unless they are up-to-date with main.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • data-migrate

    Migrate and update data alongside your database structure.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts