Public repository: timo / mitch

Reader

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

mitch / docs / roadmap / deployments.md · 1.1 KB · at 76a2c3d332a1 · raw

Deployments

Goal

Make the deployment a first-class concept: named deployments with their connection in configuration instead of a URL per call, and migrating several deployments in one run, atomically where the databases allow it (distributed transactions with two-phase commit).

Why

Deployment is one of mitch's three core concepts in the glossary, next to project and migration, but the code has no notion of it. Every command takes exactly one database URL from --database, MITCH_DATABASE_URL or DATABASE_URL. Multi-deployment runs with two-phase commit were remembered as an existing feature, but neither the code nor its history contains them.

Already settled

  • Glossary: a deployment is a concrete database that migrations are applied to; avoid "target" and "environment" for it.
  • One database can hold several projects; bookkeeping is scoped by project ID: ADR runner/multiple-projects-per-database.
  • Non-transactional migrations run in autocommit and cannot be rolled back, which limits any atomicity across deployments: ADR runner/non-transactional-migrations-run-in-autocommit.