database-migration

Plan and execute safe database migrations with rollback strategies for PostgreSQL.

3|1|Updated Dec 8, 2025
One-click install
npx skills add https://github.com/bobmatnyc/terminator --skill database-migration-bobmatnyc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-migration
Source: https://github.com/bobmatnyc/terminator/tree/main/.claude/skills/universal-data-database-migration
Command: npx skills add https://github.com/bobmatnyc/terminator --skill database-migration-bobmatnyc

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides structured guidance for planning and executing database migrations safely, focusing on zero-downtime, rollback readiness, and risk mitigation.

Core Features & Use Cases

  • Decision trees for selecting multi-phase vs additive migrations and choosing deployment patterns.
  • Pattern templates for common migrations (adding columns, renaming, changing types) with concrete SQL and steps.
  • Tooling guidance for popular ecosystems (Alembic, Django Migrations, Flyway) plus rollback strategies.

Quick Start

To migrate a production table with a breaking change, start with a multi-phase plan, prepare a backfill script, deploy dual-write code, and test thoroughly on staging before cutting over. Then monitor and be ready to rollback using the defined strategies.

Frequently Asked Questions about database-migration

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

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

Zero-downtime database migrations in PostgreSQL require multi-phase deployment patterns, additive schema changes, backfill scripts, and dual-write code strategies to serve traffic continuously during cutover. This approach provides decision trees and SQL templates to plan and execute these production-ready migrations safely.

What is the difference between additive and multi-phase database migrations?

Additive database migrations introduce new columns or tables without breaking existing code, while multi-phase migrations coordinate staged deployments with backfill scripts and dual-write logic to safely transition breaking changes. Decision trees help select the appropriate pattern based on risk and rollback readiness.

How do I plan a rollback strategy for a breaking schema change?

A rollback strategy for breaking schema changes involves defining explicit rollback SQL patterns, deploying dual-write code before cutover, and testing thoroughly on staging. This ensures production readiness by providing structured checklists and migration templates to revert safely if issues arise.

Does this database migration guidance work with Alembic, Django, and Flyway?

Yes, the database migration tooling guidance covers common frameworks including Alembic, Django Migrations, and Flyway. It provides ecosystem-specific rollback strategies and deployment patterns to integrate zero-downtime migration workflows within these popular environments.

What's the best way to rename a database column without downtime?

Renaming a database column without downtime requires a multi-phase pattern: add the new column, deploy dual-write code to populate both columns, backfill existing rows, update read paths, and finally drop the old column. Concrete SQL examples and checklists guide this process.

When should I avoid additive database migrations?

Additive database migrations should be avoided when schema changes require modifying existing column types or constraints that immediately break running application code. In these cases, multi-phase migrations with backfill scripts and staged rollouts are necessary to maintain zero-downtime deployment guarantees.