database-migrations

Plan safe, reversible database migrations with zero-downtime strategies.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/mu-zhi/CaliberHub --skill database-migrations-mu-zhi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-migrations
Source: https://github.com/mu-zhi/CaliberHub/tree/main/ai/skills/database-migrations
Command: npx skills add https://github.com/mu-zhi/CaliberHub --skill database-migrations-mu-zhi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Database migrations are risky and complex in production environments. This Skill provides a structured, tested approach for safe schema changes, data migrations, and clean rollbacks to minimize downtime and errors.

Core Features & Use Cases

  • Safe, multi-tool migration patterns (PostgreSQL, Prisma, Drizzle, Django, and Go-migrate) with explicit UP/DOWN semantics.
  • Zero-downtime strategies (expand-contract, backfill batching, concurrent indexes) and guidance on isolating schema and data migrations.
  • Use cases include adding/removing columns, renaming fields, creating indexes, and performing large data backfills with minimal lock time.

Quick Start

Apply a zero-downtime migration plan to safely introduce a new nullable column and backfill existing data.

Frequently Asked Questions about database-migrations

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I perform zero-downtime database migrations in PostgreSQL?

Zero-downtime database migrations in PostgreSQL are achieved by applying an expand-contract rollout strategy that isolates schema changes and batches data backfills. This approach ensures adding, modifying, or dropping tables and indexes does not lock production tables.

What is the expand-contract pattern for safe schema changes?

The expand-contract pattern for safe schema changes splits migrations into expand phases that add nullable columns or indexes and contract phases that remove old structures. This minimizes production downtime by allowing application code to transition between phases.

Can I use this migration guidance with Prisma, Django, and Drizzle?

Yes, this migration guidance supports safe schema changes across PostgreSQL, Prisma, Drizzle, Django, and Go-migrate tooling. It provides explicit UP and DOWN semantics for reversible migrations across these specific frameworks.

How do I backfill large datasets without locking production tables?

To backfill large datasets without locking production tables, use batch data backfills alongside concurrent indexes. This processes data in chunks to minimize lock time and maintain database availability during migrations.

Does this approach handle rollback strategies for failed migrations?

Yes, this approach handles rollback strategies for failed migrations by enforcing a migration safety checklist and supporting explicit DOWN semantics. This ensures schema and data migrations remain reversible in production environments.