database-migrations

Automate safe, reversible database migrations with rollback planning.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Migrations often become risky and time-consuming; this guide provides safe, reversible patterns to apply database schema changes without downtime.

Core Features & Use Cases

  • Zero-downtime patterns for adding columns, creating indexes, and renaming columns using expand-contract workflows.
  • Separate DDL and DML migrations with data backfills and rollback planning.
  • Guidance on testing migrations against production-sized data and maintaining rollback plans.

Quick Start

Review the Core Rules and implement a phased migration plan that preserves data integrity in production.

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 production?

Zero-downtime database migrations use expand-contract workflows, concurrent index creation, and separate DDL and DML execution to apply schema changes without disrupting production traffic. This approach enforces safe column additions and reversible schema evolutions.

What is an expand-contract workflow for schema changes?

An expand-contract workflow is a phased migration pattern that separates schema expansion, data backfill, and schema contraction to preserve data integrity. It allows safe column additions and renames while keeping the application functional throughout the migration.

How do I safely create indexes concurrently in PostgreSQL without locking tables?

Safe concurrent index creation in PostgreSQL requires explicit rules for concurrent index deployment to avoid locking tables. This Skill enforces these rules as part of a zero-downtime migration plan to maintain database availability during schema evolutions.

What is the best way to plan a rollback for a failed database migration?

The best way to plan a rollback is to document robust rollback strategies and separate DDL and DML migrations in advance. This ensures migrations are reversible and allows safe recovery if schema changes fail in production.

Why should I test database migrations against production-sized data?

Testing migrations against production-sized data is necessary to validate performance and prevent timeouts during schema evolutions. It verifies that concurrent index creation and data backfills execute safely under realistic load before reaching production.

When do I need to separate DDL and DML migrations?

You need to separate DDL and DML migrations when performing data backfills and zero-downtime schema changes in production. This separation prevents locking conflicts and ensures data integrity throughout the expand-contract workflow.