---
name: database-migration
description: "Prepare a migration that considers existing rows, rollout order, and recovery."
license: CC0-1.0
metadata:
  author: "SI Editorial"
  version: "1"
---

# Plan a reversible database change

## When to use
Prepare a migration that considers existing rows, rollout order, and recovery.

## Workflow
1. Inspect the current schema, table size, indexes, and application readers/writers.
2. Plan expand/backfill/validate/contract stages when compatibility requires them.
3. Identify lock risks, invalid existing rows, and idempotent backfill checkpoints.
4. Specify rollout verification and a recovery plan that preserves user data.

## Boundaries
Use only tools and data authorized for the task. Ask for missing requirements when they affect the result. Report what you verified and what you could not verify.

## Try it
Add a required timezone to existing bookings without interrupting writes.

## Success looks like
A staged migration plan with validation queries and recovery steps.
