BestPromptFinder
Home › Coding › Safe Database Migration Plan With a Rollback

Safe Database Migration Plan With a Rollback

Coding · Claude, ChatGPT, Gemini · coding
85AI Quality /100
95AI Usefulness est. /100
81Eval Confidence /100
No votes yetCommunity results

Quality, usefulness and confidence are AI evaluations out of 100 — not user ratings. Community results come from visitors' "worked / didn't work" votes below. How scoring works →

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

Source

Created by BestPromptFinder — editorial prompt, not user-generated. See our content & source policy.

Related Coding prompts

Python: Download a CSV From a URL
Quality 94 · GPT-5.6
Public-Market and Competitor Data Collection Agent
Quality 92 · GPT-5.6
Plain-English to SQL Query Writer
Quality 91 · GPT-5.6
PRD to MVP Technical Plan
Quality 90 · Claude Code
Third-Party API Integration
Quality 90 · Claude Code
Database Schema and Migration
Quality 90 · Claude Code