Find the source
Work out which applied migration came from a different branch and why the current code is failing.
Open-source Rails development tool
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
users.timezone.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
Try it in a 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:migrateRead installation and configuration detailsClickGems 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
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.
Work out which applied migration came from a different branch and why the current code is failing.
Manually reverse the unrelated database change, then get the current branch back to a usable state.
Every developer can hit the same mismatch as parallel branches move through review and testing.
Built for the Rails development loop
Keeps schema.rb or structure.sql aligned with the current branch, so unrelated migration state does not leave noisy or misleading schema changes behind.
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.
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.
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.
Supports multiple databases and includes optional Git hooks and a local management UI when your workflow needs them.
Works alongside AI-assisted development
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
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
Team size × minutes saved per developer ÷ 60. Annualized over 52 weeks.
Built and maintained by WideFix
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