soft_drop_columnrename onlySoft-drop column
The column gets renamed to a parked name. Restore renames it back. Cheapest reversible drop.
migrate / recover · 01 — Phase 2
Every destructive op produces an artifact— a row in a real Postgres table, plus the renamed column, archived data, or shadow copy that lets the op be reversed. Restore in one command. Cleanup when you're sure. None of Prisma, Drizzle, Atlas, or Sequelize ship this.
column or table is in use
softDropColumn / archiveColumn / dropTable
row in _zanith_migration_artifacts
rename back · or refill from archive
drop archive · delete row · permanent
02 — Five strategies
soft-drop renames in place — cheap, instant, no data movement. archive copies data out before dropping. Each comes in two flavours (column / table). The fifth captures schema for forensic use only.
soft_drop_columnrename onlyThe column gets renamed to a parked name. Restore renames it back. Cheapest reversible drop.
soft_drop_tablerename onlyThe whole table gets renamed. Indexes and constraints follow. Restore renames it back.
archive_columncopy + dropValues are copied into a parallel archive table before the column is dropped. Restore back-fills using the source PK.
archive_tableschema moveThe table moves to a parallel schema. Frees the original name. Restore moves it back.
rebuild_tableforensic onlyCaptures the pre-rebuild schema for inspection. Auto-restore would be unsafe — clients have already adapted to the new shape.
03 — The bookkeeping
Every reversible op writes a row. The row knows what was dropped, where the data parked, how to verify it's untouched, and when the auto-cleanup window closes.
04 — Seven commands
The same zanith binary that applied the migration knows how to walk it back.
recover listShow every artifact, sorted oldest last.
recover inspectDetailed view of one artifact: source, physical name, recovery plan, checksum.
recover restore-columnRe-add the column. Picks the latest matching artifact (soft-drop or archive).
recover restore-tableBring a soft-dropped or archived table back. Indexes and constraints follow.
recover exportStream archive rows out as CSV / JSONL / JSON before purge.
recover purgeDrop the archive data, delete the bookkeeping row. Permanent.
recover cleanupBulk purge artifacts older than N days. The maintenance command — run on a cron.
The main page — system overview, contrast table, lifecycle in summary.
/migrateEvery stage of a migration: generate, plan, verify, apply, audit.
/migrate/lifecycleSix levels, twenty reason codes, three CI gates. Every op classified.
/migrate/riskFour internal stages, three deployment patterns, four output modes.
/migrate/verifyFour bookkeeping tables, history CLI, six SQL queries, snapshot replay.
/migrate/auditClick-restore artifacts and export archives from the UI.
/studio