dataadvanced

Database Migration Planner

Plans safe, zero-downtime database migrations with rollback strategies.

Prompt

Plan a database migration for the following change:

**Current schema**:
{{currentSchema}}

**Desired change**: {{change}}
**Database**: {{database}}
**Table size**: approximately {{rowCount}} rows
**Downtime tolerance**: {{downtime}} (zero/minutes/hours)

Provide:
1. **Migration steps**: ordered list of ALTER/CREATE statements
2. **Zero-downtime strategy**: if needed (expand-migrate-contract pattern, shadow tables, etc.)
3. **Backfill plan**: if adding a NOT NULL column or changing data format
4. **Rollback script**: for every step, the reverse operation
5. **Testing checklist**: what to verify before, during, and after
6. **Estimated duration**: based on table size and operation type
7. **Lock analysis**: which operations take locks and for how long
8. **Application changes**: code changes needed before/after migration

Variables

{{currentSchema}}{{change}}{{database}}{{rowCount}}{{downtime}}

Use Cases

  • Production schema changes
  • Database version upgrades
  • Data model evolution

Compatible Models

claude-sonnet-4-20250514gpt-4o

Tags

migrationdatabasezero-downtimeschema-change

Details

Author
PromptIndex
Updated
2026-04-01
Difficulty
advanced

Related Prompts