Complete AI Training
Sign inGet my AI kit

Your job's AI kit

Get your AI kit

Tell us who you are and what you do. We show you your kit right away and email you the link: skills, prompts, AI agents, MCP servers and courses for your job.

500+ jobs ready, and we make a kit for any other job. No payment needed to look.

Share

AI agent for backend developers

Database Migration Rehearsal Agent

Migrations rehearsed safely with schema and data intact.

Database Migration Rehearsal Agent: what goes in, what the agent does and what you get

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.

Start and resultWhat it doesA check on its own workWaits for your OKGoes back and retries
Yes, continueApprovedNo 1 STARTS WHEN Migration added 2 USES A TOOL Run the migration in an ephemeral database 3 USES A TOOL Check schema and data invariants 4 CHECKS THE RESULT Do all invariants hold, including row counts? If not: patch the migration on the branch and rerun.Back to step 2. 5 USES A TOOL Test the rollback 6 YOU APPROVE Engineer approves merging 7 RESULT Migration rehearsal report
Read the steps as a list
  1. Migration added
  2. Run the migration in an ephemeral database
  3. Check schema and data invariants
  4. Do all invariants hold, including row counts?If not: patch the migration on the branch and rerun. Back to step 2.
  5. Test the rollback
  6. Engineer approves mergingThe agent waits here for your OK.
  7. 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.

10 minto set it up in your AI
5 AIsChatGPT, Claude, Copilot, Gemini, Grok
  • 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
Get access to this agent

An example run

What happensA migration splitting full_name into first and last name was added on May 12. It ran cleanly, but the row count dropped from 50,000 to 49,812, so the check failed. Rows with single-word names were dropped. The agent patched the logic to keep them with an empty last name and reran: 50,000 rows, constraints held, rollback worked. The engineer merged it on May 13.

More agents for backend developers