Public repository: timo / mitch

Reader

A migration stitcher (therefore mitch) for PostgreSQL, SQLite, MariaDB, and others

mitch / docs / roadmap / freeze.md · 1000 bytes · at 76a2c3d332a1 · raw

Freeze

Goal

A command analogous to pip freeze (working title mitch freeze) records the migrations a deployment has applied, in their exact order, so that another deployment can be migrated in the same order. Example: production follows staging step by step.

Why

The DAG only orders migrations that depend on each other; independent ones run in a tie-break order (creation time, then ID). Sometimes the order matters without a dependency, for example two migrations that both add values to the same enum with ALTER TYPE ... ADD VALUE, where the value order changes comparisons.

Already settled

  • Order among independent migrations is a tie-break, not a guarantee: ADR project/migrations-form-a-dag.
  • Ordering constraints (after) can fix an order without requiring the other migration: ADR project/ordering-constraints-do-not-require (specced in issue #2).
  • The audit table numbers every apply and revert sequentially, so each deployment already knows its exact history.