Open-source Rails development tool

Actual DB Schema: keep your Rails database in sync with your branch.

When you switch branches, your local database can retain migrations that do not exist in the code you are working on. Actual DB Schema detects those phantom migrations and reconciles them as part of your usual Rails migration workflow.

MIT-licensed gem · Installed in the development group

Actual DB SchemaOne column. Two branches.
  1. 01
    Branch A: add a columnApply a reversible migration adding users.timezone.
  2. 02
    Switch to branch BBranch B has no timezone migration, but the column remains in your local database. That is a phantom migration.
  3. 03
    Run rails db:migrate with the gemActual DB Schema rolls back the stored migration from branch A. The extra column is removed and the database matches branch B.

Example with the gem installed before applying branch A's migration and the optional checkout hook disabled.

Product walkthrough

See Actual DB Schema in action

Try it in a Rails application

Get started in your Rails application

Add the gem to the development group, install it, and continue running rails db:migrate. An automatic post-checkout hook is optional; use the migration task directly if you prefer explicit control.

Irreversible migrations still need manual attention. Actual DB Schema reports them rather than pretending it can safely reverse them.

group :development do
  gem "actual_db_schema"
end

bundle install
rails actual_db_schema:install
rails db:migrate
Read installation and configuration details

RubyGems download activity

Download activity at a glance

View the ClickGems dashboard
Last day
2K
Last week
9.6K
Last month
36K
Total downloads
763K

ClickGems dashboard snapshot, October 7, 2026. Download counts include repeat downloads and do not represent unique users or active installations.

The hidden cost of parallel development

One local database. Many branches. Repeated cleanup

A migration applied on one feature branch can remain in a developer's database after they switch to another branch. The code and schema no longer agree, leading to confusing errors, test failures, and noisy schema dumps.

01

Find the source

Work out which applied migration came from a different branch and why the current code is failing.

02

Repair local state

Manually reverse the unrelated database change, then get the current branch back to a usable state.

03

Repeat across the team

Every developer can hit the same mismatch as parallel branches move through review and testing.

Built for the Rails development loop

More than branch cleanup

Clean, current schema dumps

Keeps schema.rb or structure.sql aligned with the current branch, so unrelated migration state does not leave noisy or misleading schema changes behind.

Make development database changes with Ruby

Enable Console Migrations to run Rails migration DSL commands directly in the Rails console for experiments or local repairs, without writing SQL. This optional feature is disabled by default.

Trace schema changes to their migration

Annotated schema diffs identify which migration introduced a change in schema.rb. The local management UI also provides schema-diff views for investigating database changes.

Recognizes phantom migrations

Tracks executed migration code and identifies migrations that are not present in the current branch, so they can be rolled back in the correct dependency order.

Fits real Rails setups

Supports multiple databases and includes optional Git hooks and a local management UI when your workflow needs them.

Works alongside AI-assisted development

A consistent database for developers and coding agents

AI can help write migrations, but switching branches can still leave the local database out of sync. Actual DB Schema reconciles that state, helping developers and coding agents run tests against the schema their current branch expects.

Illustrative savings calculation

Small weekly savings add up across a team.

For example, if six developers each save 30 minutes a week on branch-related database cleanup, that returns three hours of engineering time every week.

These are sample assumptions, not measured results or guaranteed savings. The dollar amount represents engineering capacity at an assumed hourly cost, rather than a reduction in payroll.

Sample scenario - editable below

Engineering time returned3 hrs / week
Annual engineering time156 hours
Annual capacity value (USD)$14,040

Team size × minutes saved per developer ÷ 60. Annualized over 52 weeks.

Adjust the sample numbers

Built and maintained by WideFix

Your Rails application needs an owner.

We take ownership of existing Ruby on Rails applications, from production issues and upgrades to ongoing development. The same practical experience shapes the tools we build for Rails teams.

Explore our Rails maintenance services
Back to TopBack to Top