database-migrations

Plan zero-downtime database schema migrations across PostgreSQL and MySQL.

1|Updated May 12, 2026
One-click install
npx skills add https://github.com/Manvendra08/TradingBot --skill database-migrations-manvendra08
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-migrations
Source: https://github.com/Manvendra08/TradingBot/tree/main/_agent/skills/database-migrations
Command: npx skills add https://github.com/Manvendra08/TradingBot --skill database-migrations-manvendra08

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Unsafe, unplanned database schema changes are a leading cause of production downtime, data inconsistency, and extended outage recovery times for engineering teams.

Core Features & Use Cases

  • Cross-database and ORM support: Includes best practices for PostgreSQL, MySQL, and popular ORMs including Prisma, Drizzle, Django, TypeORM, and golang-migrate.
  • Zero-downtime migration patterns: Provides the expand-contract workflow to add, modify, or remove columns and indexes without blocking production writes.
  • Safety guardrails: Includes a pre-migration checklist, anti-pattern avoidance guidance, and batch processing patterns for large data backfills to prevent table locks and long-running transactions.
  • Use Case: A team needs to add a non-null avatar_url column to a 10M row users table without downtime; this skill guides them to add the column as nullable first, backfill data in batches, then add the NOT NULL constraint in a separate migration.

Quick Start

Use the database-migrations skill to plan and execute a zero-downtime schema change to add a nullable avatar_url column to the existing users table in your PostgreSQL production database.

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 NOT NULL column to a large PostgreSQL table without downtime?

To perform zero-downtime database migrations safely, use the expand-contract workflow to add columns as nullable first, backfill data in batches, and apply constraints in a separate migration to avoid table locks.

What is the expand-contract pattern for zero-downtime schema changes?

The expand-contract pattern is a zero-downtime database migration technique that separates schema changes into expand phases, like adding nullable columns, and contract phases, like enforcing constraints or removing old columns after application code updates.

Does this approach work with Prisma and Django ORMs for production migrations?

Yes, this zero-downtime migration approach supports common ORMs including Prisma, Drizzle, Django, TypeORM, and golang-migrate, providing reversible workflows and best practices for both PostgreSQL and MySQL production databases.

How do I safely backfill data in a 10 million row database table?

To safely backfill data in large tables, use batch processing patterns that prevent long-running transactions and table locks, ensuring the database migration does not block production writes during the data update operation.

What are common anti-patterns to avoid during production database migrations?

Common database migration anti-patterns include combining schema and data changes in one step, creating indexes without concurrent operations, and skipping rollback procedures, all of which can cause production downtime and data loss.

When do I need to separate schema migrations from data migrations?

You need to separate schema migrations from data migrations when executing zero-downtime deployment plans, as isolating structural changes from data backfills prevents long-running table locks and ensures reversible, tested migration workflows.