# Database Migrations

> Design and verify safe schema or data migrations with compatibility, batching, observability, rollback, and zero-downtime considerations.

- Skill: `egeetas/database-migrations` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add egeetas/database-migrations`
- Raw SKILL.md: https://api.skillmd.com/api/skills/egeetas/database-migrations/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: egeetas (https://skillmd.com/u/egeetas)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/egeetas/database-migrations

---


# Database Migrations

Use for schema changes, backfills, data corrections, storage-engine changes, and migration incident analysis.

## Plan

- Identify database/version, table size, traffic, replication, locks, constraints, and deployment order.
- Prefer expand-migrate-contract: add compatible structures, deploy dual-compatible code, backfill, verify, switch reads/writes, then remove legacy structures later.
- Separate schema migration from large data backfills when their operational profiles differ.
- Make long work resumable, idempotent, rate-limited, and observable.
- Define correctness queries, progress metrics, abort thresholds, backup requirements, and rollback or forward-fix strategy.

Do not assume DDL is transactional or non-blocking. Verify behavior for the actual database and version. Production execution requires explicit authorization immediately before the migration.

Test migrations against representative data and both old/new application versions when rolling deployments are possible.

