database-migrations

Plan zero-downtime database migrations across PostgreSQL, MySQL, and ORMs.

2|Updated Apr 5, 2026
One-click install
npx skills add https://github.com/mbadoz/mbadoz-skills --skill database-migrations-mbadoz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-migrations
Source: https://github.com/mbadoz/mbadoz-skills/tree/main/plugins/built-planner/skills/built-planner/references/skills/database-migrations
Command: npx skills add https://github.com/mbadoz/mbadoz-skills --skill database-migrations-mbadoz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Database teams need reliable, reversible migrations and deployment strategies to evolve schemas and migrate data without downtime across PostgreSQL, MySQL, and popular ORMs (Prisma, Drizzle, Django, TypeORM, golang-migrate).

Core Features & Use Cases

  • Safe, reversible migrations for schema changes and data migrations.
  • Zero-downtime deployment strategies including the expand-contract pattern.
  • Guidance on tooling and workflow across PostgreSQL, MySQL, Prisma, Drizzle, Django, TypeORM, and golang-migrate.

Quick Start

Plan your migration using a zero-downtime expand-contract approach: add a nullable or defaulted new column, backfill data, update app logic to read from the new column, then remove the old one.

Frequently Asked Questions about database-migrations

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

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

Zero-downtime database migrations in PostgreSQL use an expand-contract pattern: add nullable or defaulted new columns, backfill data, update app logic to read from the new column, then remove the old one. This approach separates schema changes from data migrations to ensure concurrent-safe operations.

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

The expand-contract pattern is a zero-downtime deployment strategy that separates schema and data migrations. You first expand by adding new nullable or defaulted columns and backfilling data, then update application logic, and finally contract by removing the old columns after the transition is complete.

Can I use this for zero-downtime migrations with Prisma or Django ORMs?

Yes, this supports zero-downtime migrations across common ORMs including Prisma, Drizzle, Django, TypeORM, and golang-migrate. It provides reversible migration workflows and deployment guidance tailored to each tool's specific capabilities for schema changes and data migrations.

What's the best way to plan a reversible data migration in MySQL?

The best way to plan a reversible data migration in MySQL is to separate schema changes from data migrations and apply concurrent-safe operations. Using the expand-contract pattern ensures you can roll back safely by keeping old columns intact until the new structure is fully validated in production.

Why do I need to separate schema and data migrations for production deployments?

Separating schema and data migrations is required for production deployments because it enables concurrent-safe operations and zero-downtime rollbacks. Mixing them locks tables and blocks application logic, whereas splitting them allows you to backfill data gradually while the application continues serving traffic.

How do I handle rollback planning for database schema changes?

Rollback planning for database schema changes relies on the expand-contract pattern to ensure reversibility. By keeping old columns and data intact during the expand phase, you can safely contract or revert to the previous schema if the new application logic or data backfill encounters issues in production.