database-migrations

Plan reversible database migrations across PostgreSQL, MySQL, and common ORMs.

Updated Apr 4, 2026
One-click install
npx skills add https://github.com/mitul-bhatia/Vibes --skill database-migrations-mitul-bhatia
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-migrations
Source: https://github.com/mitul-bhatia/Vibes/tree/main/.github/skills/database-migrations
Command: npx skills add https://github.com/mitul-bhatia/Vibes --skill database-migrations-mitul-bhatia

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Database teams struggle with risky schema changes, data migrations, and drift across environments. This guide provides best-practice patterns, checklists, and tooling recommendations to execute migrations safely and reversibly.

Core Features & Use Cases

  • Migration safety: ensure UP/DOWN or explicit irreversible, separate schema and data changes, and provide rollback plans.
  • Zero-downtime strategies: expand-contract patterns, backfill data in dedicated migrations, and minimize production lock time.
  • Tooling guidance: covers Prisma, Drizzle, Kysely, Django, TypeORM, and golang-migrate workflows with practical examples.

Quick Start

Apply the expand-contract migration strategy by adding a nullable new column, backfilling data, then switching reads to the new column before removing 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 perform zero-downtime database migrations in production?

Zero-downtime database migrations use the expand-contract pattern: add a nullable new column, backfill data, switch reads to the new column, then remove the old one. This minimizes production lock time and ensures safe schema changes.

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

The expand-contract pattern adds a nullable new column, backfills existing data into it, switches application reads to the new column, and finally removes the old one. This ensures reversible schema changes without disrupting production traffic.

How do I handle database rollbacks when a migration fails?

Handle database rollbacks using UP/DOWN migration patterns to reverse schema changes. The approach enforces migration safety checks and requires an explicit rollback plan for irreversible changes, ensuring you can revert any failed deployment safely.

Does this database migration approach work with Prisma, Django, and TypeORM?

Yes, this approach works with Prisma, Django, TypeORM, Drizzle, Kysely, and golang-migrate. It provides specific tooling guidance, practical workflow examples, and best-practice checklists for executing safe migrations across these ORMs.

What is the best way to separate schema changes from data migrations?

The best way to separate schema changes from data migrations is to place data backfills into dedicated migrations. This isolates risks, enforces migration safety checks, and provides clear rollback plans for each distinct operation.

When should I avoid running irreversible database migrations?

You should avoid irreversible database migrations whenever possible by using UP/DOWN patterns. If a migration must be irreversible, the process requires an explicit rollback plan and safety checks to ensure production database stability.