database-migrations

Plans zero-downtime database schema and data migrations for PostgreSQL and MySQL.

2|Updated Apr 7, 2026
One-click install
npx skills add https://github.com/Zenobia000/ai-brainstorming --skill database-migrations-zenobia000
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-migrations
Source: https://github.com/Zenobia000/ai-brainstorming/tree/main/.claude/custom-rule%26skill/skills/database-migrations
Command: npx skills add https://github.com/Zenobia000/ai-brainstorming --skill database-migrations-zenobia000

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the risk of production outages, data loss, and application errors caused by unsafe, unplanned database schema and data migrations.

Core Features & Use Cases

  • Cross-ORM migration support: Provides guidance for PostgreSQL and MySQL across Prisma, Drizzle, Django, TypeORM, and golang-migrate for schema changes, data backfills, and index management.
  • Zero-downtime deployment patterns: Implements the expand-contract pattern to safely modify tables, rename columns, and add indexes without service interruption.
  • Use Case: For example, when adding a new required column to a 10M-row user table, this Skill guides you to add it as nullable first, backfill data in batches, then add the NOT NULL constraint without locking the table or taking the app offline.

Quick Start

Use the database-migrations skill to create a zero-downtime migration plan for adding a new non-null email column to your existing 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 required column to a large table without locking the database?

To add a required column without database locks, use the expand-contract pattern: add the column as nullable first, backfill data in batches, then apply the NOT NULL constraint. This ensures zero-downtime schema changes for large production tables.

What is the expand-contract pattern for zero-downtime database migrations?

The expand-contract pattern is a zero-downtime migration strategy that separates schema changes into expand phases, adding new structures without breaking old code, and contract phases, removing deprecated structures after application deployment. It prevents full table locks.

Can I use this approach with Prisma, Django, or TypeORM for PostgreSQL schema changes?

Yes, this zero-downtime migration approach works with PostgreSQL and MySQL environments using Prisma, Drizzle, Django, TypeORM, and golang-migrate. It supports reversible, forward-only migration patterns for schema changes and data backfills.

How do I backfill data in batches during a production database migration?

Batch data backfilling during production database migrations involves updating rows in incremental chunks rather than a single transaction. This avoids long-running locks and allows zero-downtime data operations alongside expand-contract schema workflows.

What's the best way to create indexes on large tables without causing application downtime?

The best way to create indexes without application downtime is using concurrent index creation methods within a forward-only migration plan. This avoids full table locks and maintains service availability during production schema changes.

Why do database migrations cause production outages and how can I prevent them?

Database migrations cause production outages when schema changes acquire full table locks, block reads and writes, or introduce incompatible application code. Prevent these issues using tested, reversible, zero-downtime expand-contract patterns and batch operations.