database-migrations

Create zero-downtime migration plans for PostgreSQL and MySQL schema changes.

2|Updated Mar 12, 2026
One-click install
npx skills add https://github.com/sayasaya8039/ZWG_Terminal --skill database-migrations-sayasaya8039
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-migrations
Source: https://github.com/sayasaya8039/ZWG_Terminal/tree/main/.claude/skills/database-migrations
Command: npx skills add https://github.com/sayasaya8039/ZWG_Terminal --skill database-migrations-sayasaya8039

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Database schema and data changes in production carry high risk of unplanned downtime, data corruption, and unrepeatable manual errors that can impact users and require emergency rollbacks.

Core Features & Use Cases

  • Safe Schema Change Patterns: Step-by-step guidance for adding columns, creating concurrent indexes, and renaming columns without locking tables or blocking writes for PostgreSQL and MySQL.
  • ORM-Specific Workflows: Pre-built workflows and examples for Prisma, Drizzle, Django, TypeORM, and golang-migrate to generate and apply migrations consistently.
  • Zero-Downtime Deployment Strategies: Expand-contract pattern for large-scale changes, plus batch data backfill scripts that avoid long-running transactions on large tables.
  • Use Case Example: If you need to add a non-null phone_number column to a 10M row user table without interrupting service, this skill provides the exact migration sequence and backfill logic to complete the change safely.

Quick Start

Use the database-migrations skill to create a zero-downtime migration plan for adding a new required phone_number column to your production users table.

Frequently Asked Questions about database-migrations

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

FAQPage Schema
How do I add a non-null column to a large production table without downtime?

You perform zero-downtime migrations by adding the column as nullable first, then backfilling data in batches to avoid locking tables, and finally enforcing constraints in a later migration phase. This prevents long-running transactions and production outages.

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

The expand-contract pattern is a zero-downtime deployment strategy that separates schema modifications into expand phases to add new structures and contract phases to remove old ones. It prevents locking tables and enables reversible migration workflows.

Does this database migrations workflow support Prisma and Django?

Yes, the database migrations workflow supports Prisma and Django, along with Drizzle, TypeORM, and golang-migrate. It provides pre-built workflows and examples to generate and apply migrations consistently across PostgreSQL and MySQL environments.

How do I create concurrent indexes in PostgreSQL without blocking writes?

To create concurrent indexes in PostgreSQL without blocking writes, you use safe schema change patterns that avoid exclusive table locks. This skill provides step-by-step guidance for concurrent index creation and column renames to maintain write availability.

What is the best way to backfill millions of rows in MySQL safely?

The best way to backfill millions of rows safely is using batch data backfill scripts that avoid long-running transactions on large tables. This prevents data corruption risks and unplanned downtime during large-scale data modifications.

Why do database migrations cause table locks and how can I prevent them?

Database migrations cause table locks when schema changes block ongoing write operations, leading to production outages. You prevent them by enforcing safe, repeatable migration patterns like concurrent index creation and batch backfills.