Database Engineering — Safe Migrations
Alembic migration generation with upgrade/downgrade verification and provenance.
Context
Automated database migration generation with upgrade-downgrade cycle verification and provenance tracking.
Flow with 4 tools
◻ Phase 01 — intake
Migration spec
Generates spec from Jira and current schema.
◻ intake
intake init "Add Audit Trail Tables" \
--source jira://DB/DB-456 \
--source schema/current-erd.png \
--format architect △ Phase 02 — architect
Migration generation
Loop with upgrade and downgrade verification.
△ architect
architect loop "Generate Alembic migration for audit trail" \
--check "alembic upgrade head" \
--check "alembic downgrade -1 && alembic upgrade head" \
--check "vigil scan migrations/" \
--max-iterations 10