database-migrations

Coordinate phased database migrations across PostgreSQL and MySQL with rollback support.

1|Updated Mar 18, 2026
One-click install
npx skills add https://github.com/xxih/ai-harness-zh --skill database-migrations-xxih
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-migrations
Source: https://github.com/xxih/ai-harness-zh/tree/main/references/translations/everything-claude-code/docs/zh-CN/skills/database-migrations
Command: npx skills add https://github.com/xxih/ai-harness-zh --skill database-migrations-xxih

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It provides a safe, repeatable pattern for evolving production database schemas and data, including schema changes, data migrations, and rollback procedures, while aiming for zero downtime.

Core Features & Use Cases

  • Safe schema evolution using phase-based approaches (expand, migrate, contract).
  • Separate schema and data migrations to minimize locking and ensure data integrity.
  • Guidance for ORM and native SQL tools (Prisma, Django, Drizzle, TypeORM, golang-migrate) across PostgreSQL, MySQL, etc.

Quick Start

Create and apply a migration following the expand-migrate-contract phases for a production table.

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 use an expand-migrate-contract phase strategy to apply schema changes and data updates without locking tables or disrupting production traffic.

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

The expand-migrate-contract pattern separates schema evolution into three stages: expanding the schema, migrating data, and contracting old structures, ensuring data integrity while avoiding locks during deployment.

Can I use this approach with Prisma, Django, or TypeORM for data migrations?

Yes, this approach supports ORM and native SQL tools including Prisma, Django, Drizzle, TypeORM, and golang-migrate, providing guidance for managing UP and DOWN migrations across these frameworks.

What is the best way to handle large dataset migrations without table locks?

Handling large datasets without locks requires separating schema changes from data migrations and applying a phased deployment strategy, which minimizes locking and maintains data integrity throughout the process.

How do rollback procedures work with phased schema deployment?

Rollback procedures work by applying UP and DOWN migrations within the phased expand-migrate-contract deployment, allowing you to safely reverse schema changes and data updates if production issues occur.

When do I need to separate schema and data migrations for MySQL?

You need to separate schema and data migrations for MySQL when evolving production databases with large datasets, as isolating these steps minimizes table locking and ensures continuous data integrity.