database-migration-planner

Plan expand-contract database migrations with rollback steps for PostgreSQL.

Updated May 24, 2026
One-click install
npx skills add https://github.com/haJ1t/senior-dev-squad-skills --skill database-migration-planner
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-migration-planner
Source: https://github.com/haJ1t/senior-dev-squad-skills/tree/main/plugins/senior-dev-squad/skills/database-migration-planner
Command: npx skills add https://github.com/haJ1t/senior-dev-squad-skills --skill database-migration-planner

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires psycopg2, sqlalchemy, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps developers safely plan and execute schema changes on live databases by enforcing the expand-contract pattern, preventing issues like long locks, data corruption, and rollbacks that can lead to downtime.

Core Features & Use Cases

  • Expand-Contract Migration: Safely adds schema changes before removing old structures.
  • Audit & Rollback Plan: Provides a structured approach to migration planning, ensuring reversible changes.
  • Use Case: Before renaming a column in a production database, use this Skill to add a new column, populate it, validate changes, and then remove the old column.

Quick Start

Use the database-migration-planner skill to rename the 'user_name' column to 'display_name' in the 'users' table.

Frequently Asked Questions about database-migration-planner

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

FAQPage Schema
How do I safely rename a column in a live PostgreSQL database without downtime?

To safely rename a column in a live PostgreSQL database, use the expand-contract pattern to add the new column, migrate data, and drop the old structure later. This prevents long locks and downtime.

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

The expand-contract pattern for database schema changes safely adds new structures before removing old ones. It separates migrations into expand and contract phases to prevent data corruption and long locks.

How do I write a rollback plan for DDL operations and table normalization?

Write a rollback plan for DDL operations by defining explicit reversal steps for each expand and contract phase. This ensures database normalization and indexing changes remain reversible without data loss.

Do I need SQLAlchemy and psycopg2 to plan database migrations?

You need SQLAlchemy and psycopg2 to plan database migrations because this Skill requires Python scripting and PostgreSQL connectivity to characterize tables and verify database safety before contracting.

How do I identify lock tiers before executing DDL on a production database?

Identify lock tiers before executing DDL by characterizing tables and evaluating schema change requirements. This determines the database safety level and helps structure expand-contract migration steps.

What are the limitations of using expand-contract migrations for schema changes?

A limitation of using expand-contract migrations is that completing schema changes requires multiple deployment phases. You must verify data integrity before the contract phase, making immediate cutover impossible.