BestPromptFinder
Safe Database Migration Plan With a Rollback
85AI Quality /100
95AI Usefulness est. /100
81Eval Confidence /100
No votes yetCommunity results
The prompt
Plan a database change that won't take my app down. Database: [PostgreSQL / MySQL / MongoDB / other], size: [rows in affected tables] Change: [e.g. rename a column, split a table, add a NOT NULL column, change a type, add an index] Current schema for affected tables: [paste] App: [how it reads and writes these tables; can I deploy app changes separately?] Downtime allowed: [none / a few minutes at night] Give me: 1. A step-by-step plan using expand and contract: add the new structure, write to both, backfill, switch reads, then remove the old structure, with the app changes needed at each step. 2. The SQL or migration-tool code for each step. 3. How to backfill large tables in batches without locking them, and how to check progress. 4. A rollback for every step and the point after which rollback needs a restore. 5. Checks before and after: row counts, sample comparisons, query performance. 6. A backup step before anything runs. Rules: flag any statement that locks a table or rewrites it; don't assume features my database version may not have; mark them [CHECK VERSION].Find similar in the app →
Did this prompt work for you?
Why this prompt
- Hand-picked, editorially reviewed prompt
- Written for Claude, ChatGPT, Gemini
Source
Created by BestPromptFinder — editorial prompt, not user-generated. See our content & source policy.
Related Coding prompts
Python: Download a CSV From a URLQuality 94 · GPT-5.6Public-Market and Competitor Data Collection Agent
Quality 92 · GPT-5.6Plain-English to SQL Query Writer
Quality 91 · GPT-5.6PRD to MVP Technical Plan
Quality 90 · Claude CodeThird-Party API Integration
Quality 90 · Claude CodeDatabase Schema and Migration
Quality 90 · Claude Code