AI agent for backend developers
Database Migration Rehearsal Agent
Migrations rehearsed safely with schema and data intact.
What it does
Database migrations often work on test data but fail on edge cases in real data. When a migration script is added to a branch, this agent runs it in a temporary database loaded with a synthetic fixture that mimics real data shapes. It checks schema and data rules: row counts, constraints, nulls and key relationships. If any rule fails, it patches the migration on the branch and reruns. A migration that finishes but loses rows counts as a failure. It also tests the rollback. An engineer approves merging; production migrations stay with people. Edge case: a column split succeeds, but rows with empty values are silently dropped, so the agent patches the logic.
How it works
Follow the arrows from top to bottom. The orange dashed arrow is the loop: when a check fails, the agent goes back and tries again.
Read the steps as a list
- Migration added
- Run the migration in an ephemeral database
- Check schema and data invariants
- Do all invariants hold, including row counts?If not: patch the migration on the branch and rerun. Back to step 2.
- Test the rollback
- Engineer approves mergingThe agent waits here for your OK.
- Migration rehearsal report
How it decides
It identifies which invariant failed and chooses the matching code correction.
- The correction targets the specific failed rule.
- Any data loss counts as failure.
- The rollback must also pass before approval.
Make it yours
Every agent is a starting point. You choose these settings for your own situation.
- Synthetic fixture and its size
- Data rules checked (default row counts, constraints, nulls)
- Maximum patch attempts (default 3)
- Who approves merging
What keeps you in control
It always asks you first
- Production migration
- Merging
Hard limits
- Never touches production.
It stops when
- Done: invariants and rollback pass.
Set it up
We guide you through the set-up, step by step
Members get the full set-up guide for this agent. No technical skills needed: you copy, paste and upload.
- One set of instructions to paste into your AI, with the clicks for ChatGPT, Claude, Microsoft 365 Copilot, Gemini and Grok
- The agent then walks you through connecting your own data, one source at a time
- A downloadable copy with the flow chart, the rules and the full guide