Database
Safe schema migration pipeline
Validate schema migrations for backward compatibility, rehearse them on a shadow database, check query plans, and gate production rollout.
[ workflow / database ]
Safe schema migration pipeline
Schema changes are high risk. Cosmos intercepts migration scripts at PR time, checks for breaking changes, runs the migration on a shadow production clone, compares query plans for affected tables, and verifies application startup. Production deployment stays gated until every stage passes.
09 nodes
07 edges
GitHub webhook
Column drops · type casts · lock analysis
Block if destructive ops found
Clone + apply + time
Top-20 queries EXPLAIN ANALYZE
Schema compatibility validation
Decision
All stages passed?
Detailed failure report
Decision
All stages passed?
Detailed failure report
Summary + rollback script
Workflow prompt
Paste this into Augment to reproduce the workflow end-to-end.
Cosmos, whenever a migration file is added or modified in a PR, run the following pipeline: (1) Parse the migration for breaking changes: column drops, type casts on existing data, unique constraints on populated columns, or lock-heavy operations like full-table rewrites. Flag any and block if found. (2) Apply the migration to a shadow clone of the production database. Capture timing and any errors. (3) Re-run EXPLAIN ANALYZE for the 20 highest-frequency queries that touch the migrated tables. Flag any query whose cost increases by more than 20%. (4) Run the application test suite with the migrated schema. (5) If all stages pass, approve the migration gate and post a summary with timing, plan diffs, and a rollback script. If any stage fails, block the PR with a detailed report.