PromptSharp › Prompt Library › Dev & Engineering › Migration script review: read a schema change before it touches production data
Migration script review: read a schema change before it touches production data
A database migration is in the PR and it runs against a large production table. Review it for locking, data loss, and rollback before the deploy window.
The prompt — copy and run it
You are a senior database engineer reviewing a schema or data migration before it runs in production. I will paste the migration, the table definitions it touches, and rough table sizes. Produce: A) WHAT IT DOES — the migration restated step by step in plain English, including any implicit behavior (default values backfilled, indexes rebuilt, constraints validated). B) RISK TABLE — each step: lock type and likely duration given the sizes I gave, data-loss risk, whether it is reversible, and whether old application code still works while it runs. Mark lock behavior that depends on the database version as "verify for your version". C) SAFER SEQUENCE — if any step is risky, the expand-and-contract alternative: add new structure, dual-write or backfill in batches, switch reads, then remove the old structure, each as a separate deploy. D) ROLLBACK PLAN — the exact reverse steps, and which steps cannot be reversed once data is changed. E) PRE-FLIGHT CHECKS — what to run on a staging copy first, and the metric to watch during the production run. Inputs: [PASTE MIGRATION] · [PASTE AFFECTED TABLE DEFINITIONS] · [ROW COUNTS + TRAFFIC LEVEL] · [DATABASE ENGINE + VERSION] · [DEPLOY PROCESS] Rules: Do not invent locking behavior, table sizes, or engine features — tie every risk to what I pasted and mark engine-specific claims for verification against the official documentation. Verify the migration on a staging copy with production-like volume before running it live. Never paste real customer rows, credentials, or connection strings; use schema and counts only.
How to use this prompt
- Copy the full prompt above with the Copy button.
- Fill in your inputs. Replace each bracketed placeholder with your specifics:
[PASTE MIGRATION][PASTE AFFECTED TABLE DEFINITIONS][ROW COUNTS + TRAFFIC LEVEL][DATABASE ENGINE + VERSION][DEPLOY PROCESS] - Paste into ChatGPT, Claude, or Gemini and run. Read the reality guardrail below before you act on the output.
Why this prompt works
Migrations are the change most likely to turn a routine deploy into an outage, because the risk sits in lock duration and irreversibility rather than in the code itself. Restating each step, rating lock and reversibility, and offering an expand-and-contract sequence gives the reviewer the questions that matter. The rollback plan forces the author to admit which steps cannot be undone before they run.
Get a prompt like this in your inbox
The PromptSharp Dev Brief ships one desk-ready prompt every weekday — free on the web today. Free forever. Today's Dev & Engineering issue is live on the web right now — subscribe and we email you the sample issue immediately, then the Dev & Engineering daily by email most weekday mornings, plus a Sunday roundup. Unsubscribe anytime.
Subscribe free → Read a sample issueWant the full PromptSharp Dev Brief, not just the free prompt? Vertical Pro is the full Pro benefit set for ONE vertical. See what Pro includes.
Card required. Free for 14 days, then $14.99/month — renews automatically until you cancel. Cancel anytime before day 14 and you won’t be charged. One free trial per card. Manage or cancel anytime.
Frequently asked
When should I use this prompt?
A database migration is in the PR and it runs against a large production table. Review it for locking, data loss, and rollback before the deploy window.
Why does this prompt work?
Migrations are the change most likely to turn a routine deploy into an outage, because the risk sits in lock duration and irreversibility rather than in the code itself. Restating each step, rating lock and reversibility, and offering an expand-and-contract sequence gives the reviewer the questions that matter. The rollback plan forces the author to admit which steps cannot be undone before they run.
What mistake does this prompt help you avoid?
Migrations reviewed as code instead of as operations: each step is rated for locking, data loss, reversibility, and compatibility with code still running.
Related Dev & Engineering prompts
Dependency upgrade review: find the breaking changes before your users do
A dependency bump PR is waiting, and the version jump is larger than usual. Read the changelog against your actual usage before me…
Security-first PR review: a diff read that hunts the bug class, not the typo
You're reviewing a big PR and low on time. Get a structured read that prioritizes correctness and security over style nits.…
Performance regression hunt: from a slower endpoint to the change that caused it
An endpoint got noticeably slower after last week's releases. Narrow it down to the change and the mechanism before anyone starts …
Design doc skeleton with the alternatives you'll actually be asked about
New system or big refactor. Draft the design doc with real alternatives and failure modes before the review meeting drafts it for …
RFC skeleton: pressure-test the design before you write the code
You're about to build something non-trivial. Draft an RFC that names the tradeoffs and the rejected alternatives, so review is rea…
API contract review: versioning, errors, and the changes your clients will feel
You are adding or changing an API that other teams or customers call. Review the contract for compatibility before it ships and be…
Build or adopt: compare writing it yourself against an existing library or service
The team is about to build a component that might already exist off the shelf. Compare the options on total cost, risk, and lock-i…
All Dev & Engineering free prompts
The PromptSharp Dev Brief page — five full free prompts plus today's issue.
PromptSharp Daily — free
The cross-vertical sampler: one sharp, copy-paste prompt most weekday mornings, plus a Sunday roundup, rotating across the roster. Two things in one brief: you get better at AI and prompting, and you see the sharpest prompts from across the network. If a day's issue misses our quality bar, we hold it instead of padding your inbox.
Double-opt-in. Unsubscribe anytime. No spam, ever.
Even a sharp prompt starts from zero unless your AI knows you. Brainfile is persistent context — your work, voice, and priorities loaded into every session. Brainfile is the memory; PromptSharp is the playbook. Together they compound — the same prompt gets sharper because it runs on YOUR context.
Set up your brainfile →Want both? The All-Access + Brainfile annual bundle covers the pair.
Home · Daily Issues · Prompt Library · Glossary · Pricing · For Teams & Universities · Archive · PromptFluent alternative · Newsletter · Privacy · Terms · Refunds
Marketing · Sales · Dev & Engineering · Finance · Product Management · Vibe Coding · C-suite · Consulting & Strategy · Law · CPG · Personal Finance · Career & Job Search · Trading · Health & Fitness · Students · Focus & Productivity · Learning · Travel Planning
Entry Point Trading
Free weekly stocks to watch —
how our model ranks the S&P 500 and Nasdaq 100.