You're about to ship a release that bumps your local database schema. Being careful, you also prepare a rollback build , the version currently in production, so that if the new release has problems you can push the old one straight back out.
Then you test the rollback, and it crashes on startup.
This post covers:
Why Drift refuses to "upgrade" to a lower schema version
The fix (and why the obvious fix doesn't work)
A bug that's easy to introduce while making the fix
The git worktree workflow for building both versions side by side
Building three test APKs so QA can test upgrade → rollback → re-upgrade without losing data
All names, branches and paths below are made up for the article.
The setup
Production ( v1.4.1 ) uses database schema 11 .
The new release ( v1.5.0 , branch feature/new-release ) moves to schema 12 .…