In a conventional migration workflow, each branch generates its own migration files. When those branches merge, the migration history diverges: two files with different versions, different SQL, and no clear winner. The database cannot tell which branch's changes are correct, and neither can the developer without reading both files and comparing them against the models.
dbwarden treats branch migrations as derived artifacts. The models are the source of truth; the migration files are outputs. After a Git merge, dbwarden computes the correct next change as the diff between the merge-base state and the merged models. The branch files remain as provenance, but the reconciliation migration is the only new runnable migration.
Generation and status detect divergent bases, version collisions, and snapshot discontinuities. Until the merge is resolved, make-migrations refuses to generate from an ambiguous history. This prevents the common failure mode where two developers generate migrations on top of the same base, merge, and end up with two migrations that conflict.
$ dbwarden status
Database: primary
Merge: PENDING
$ dbwarden make-migrations "add feature" --database primary
Error: Merge pending. Resolve before generating.-- After a Git merge, dbwarden detects:
-- 1. Divergent bases (branch migrations from same base)
-- 2. Version collisions (same version, different SQL)
-- 3. Snapshot discontinuities (state mismatch)
-- Status reports: Merge: PENDING
-- make-migrations refuses until resolved