Back to blog

Blog

Managing Rails Database Schemas Across Branches: A Practical Guide to db/schema.rb Conflicts

The Problem Every Rails Team Faces (But Few Talk About)

Apr 13, 2026 · ruby, schema, activerecord, postgresql, ruby-on-rails
Managing Rails Database Schemas Across Branches: A Practical Guide to db/schema.rb Conflicts
You open a pull request. CI passes. Code review looks good. Then: git merge master produces this: CONFLICT (content): Merge conflict in db/schema.rbAutomatic merge failed; fix conflicts and commit the result. Your heart sinks. Your branch added a migration. So did another developer on master. Now you have to untangle the schema version numbers, table definitions, and index declarations that Git helpfully marked with <<<<<<< and >>>>>>>. This article shares hard-won lessons from managing a large Rails 8 multi-tenant application where 5+ developers regularly add migrations in parallel branches. These aren’t theoretical solutions — they’re the patterns that kept my team’s db/schema.rb sane and CI green. Why db/schema.rb Conflicts Hurt More Than Code Conflicts. Unlike normal merge conflicts where you can reason about intent, schema conflicts are structural: The Migration Timestamp Problem...

The full article is published on Medium.

Read on Medium