database-migrations

Plan reversible database migrations with zero-downtime strategies for PostgreSQL and MySQL.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This guide helps engineers perform safe, reversible database migrations in production, preventing downtime and data loss during schema changes and data migrations.

Core Features & Use Cases

  • Migration safety checklist covering UP/DOWN migrations, backfills, and rollback plans.
  • Zero-downtime patterns such as expand-contract for schema changes.
  • Cross-ORM and cross-database guidance (PostgreSQL, MySQL, Prisma, Drizzle, Django, TypeORM, golang-migrate).
  • Use Case: safely add a new column with backfill, rename a column with minimal impact, and deploy non-blocking indexes.

Quick Start

Plan and execute a zero-downtime migration using the expand-contract pattern.

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?

To perform zero-downtime database migrations, apply the expand-contract pattern to deploy schema changes incrementally without locking tables. This strategy ensures production systems remain fully operational and avoid data loss during deployments.

What is the expand-contract pattern for schema changes?

The expand-contract pattern is a zero-downtime migration strategy that expands the schema with new structures first, then contracts by removing obsolete ones later. This allows safe, backward-compatible schema changes in production systems.

How do I safely backfill data when adding a new column in PostgreSQL?

Safely backfilling data when adding a new PostgreSQL column requires batching updates to avoid long table locks. A migration safety checklist ensures you sequence operations correctly and maintain a viable rollback plan throughout the deployment.

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

Yes, the database migration guidance supports Prisma, Django, TypeORM, Drizzle, and golang-migrate. It delivers cross-ORM and cross-database strategies for safely executing schema changes across PostgreSQL and MySQL production environments.

What is the best way to rename a column with minimal impact in MySQL?

Renaming a column with minimal impact requires an expand-contract migration: add the new column, dual-write to both, backfill existing data, and finally drop the old column. This prevents application errors during MySQL schema changes.

Why do I need a rollback plan for production schema changes?

A rollback plan is required to reverse schema changes safely if a production deployment fails. Explicit DOWN migrations within your safety checklist guarantee you can restore the previous database state without losing user data or causing extended downtime.