Plan a safe zero-downtime database migration step by step
Schema changes on live production databases are high-risk. This prompt produces an ordered migration plan that keeps the app running throughout, including rollback checkpoints at each phase.
You are a database reliability engineer. Help me plan a zero-downtime migration for a production database.
Database engine and version: {{DB_ENGINE_VERSION}}
Current schema (relevant tables only):
```
{{CURRENT_SCHEMA}}
```
Desired end state (describe the change in plain English):
{{DESIRED_CHANGE}}
Application deployment model: {{DEPLOYMENT_MODEL}}
(e.g., 'rolling Kubernetes pods', 'blue-green', 'single server with maintenance window')
Produce the following:
1. Expand-contract analysis: identify which steps must happen before the app code changes (expand) and which happen after (contract).
2. Write each migration step as a discrete, reversible SQL statement or migration file. Number them.
3. For each step, specify: (a) whether old and new app code can run simultaneously during this step, (b) estimated lock duration or table unavailability, (c) the exact rollback statement.
4. Flag any step where data loss is possible, even temporarily.
5. Recommend validation queries to run after each step to confirm correctness before proceeding.
6. Note if this migration pattern does not apply to the given deployment model, and suggest an alternative. {{DB_ENGINE_VERSION}}{{CURRENT_SCHEMA}}{{DESIRED_CHANGE}}{{DEPLOYMENT_MODEL}}
How to use this prompt
- Copy the prompt above (Copy button on the top-right).
- Replace each
{{VAR}}with your own value. Variables:{{DB_ENGINE_VERSION}}{{CURRENT_SCHEMA}}{{DESIRED_CHANGE}}{{DEPLOYMENT_MODEL}}. - Paste it into one of the recommended tools below.
- Iterate: tighten constraints in the prompt if the output is generic.
Why this prompt is structured this way
The prompt is split into explicit steps because LLMs do better when the path is named, not implied. Each variable forces specificity at the input layer — vague inputs get vague outputs.
Pair this prompt with a tool
Perplexity
$0/mo (Pro at $20)AI search engine with citations.
Perplexity is the answer engine Google would build if it weren't protecting search ad revenue. Cited answers, follow-up questions, focused source modes.
Claude (Anthropic)
$0/mo (Pro at $20)Frontier model with long context and strong reasoning.
Claude (Opus / Sonnet / Haiku tiers) is the assistant favored by writers and engineers who care about reasoning quality and tone. 1M token context on Opus.
ChatGPT (OpenAI)
$0/mo (Plus at $20)The category-defining general-purpose AI assistant.
ChatGPT has the broadest feature surface: image gen, voice, custom GPTs, web browsing, code execution. Often the right default; sometimes beaten on specific tasks by Claude or Perplexity.
Cursor
$20/moAI-first code editor forked from VS Code.
Cursor is VS Code with first-class LLM integration. Multi-file edits, codebase Q&A, autocomplete that's actually useful. The default IDE for many shipping engineers in 2026.
The PlaybookPrompts weekly
One short email per week. The five sharpest prompts we found, one tool worth your attention, one anti-pattern to avoid. Unsubscribe in one click.
Newsletter signup is not configured. Set PUBLIC_NEWSLETTER_USERNAME in the build env.