database-migrations

Plan zero-downtime PostgreSQL and MySQL schema migrations with expand-contract strategies.

2|Updated May 11, 2026
One-click install
npx skills add https://github.com/himanshu231204/AI_Research_agent --skill database-migrations-himanshu231204
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-migrations
Source: https://github.com/himanshu231204/AI_Research_agent/tree/main/.opencode/skills/database-migrations
Command: npx skills add https://github.com/himanshu231204/AI_Research_agent --skill database-migrations-himanshu231204

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill eliminates the risk of production outages, data loss, and extended downtime caused by unplanned or unsafe database schema and data changes, which are a common source of critical incidents for engineering teams.

Core Features & Use Cases

  • Multi-database and ORM support: Provides migration best practices for PostgreSQL, MySQL, and popular ORMs including Prisma, Drizzle, Kysely, Django, TypeORM, and golang-migrate.
  • Zero-downtime migration patterns: Implements the expand-contract workflow to safely alter large production tables without disrupting user traffic.
  • Safe data migration and backfill: Includes batch update strategies that avoid long-running table locks, even for datasets with millions of rows.
  • Production guardrails: Offers a pre-migration safety checklist, rollback procedures, and anti-pattern guidance to prevent common migration failures.
  • Use case example: If you need to add a non-null column to a 10 million row users table without taking your service offline, this skill walks you through the safe, phased workflow to avoid locking the table and impacting users.

Quick Start

Use the database-migrations skill to plan and execute a zero-downtime schema change to add a new nullable avatar_url column to your production 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 non-null column to a large production table without downtime?

To add a non-null column without downtime, apply an expand-contract migration workflow by first deploying the column as nullable, batch backfilling the data, and finally enforcing the constraint. This prevents long-running table locks on large datasets.

Does this zero-downtime migration approach work with Prisma and TypeORM?

Yes, this zero-downtime migration approach applies to Prisma and TypeORM, as well as Drizzle, Kysely, Django, and golang-migrate, providing safe schema change patterns and rollback guardrails across these specific ORMs and tools.

What is the best way to backfill millions of rows in PostgreSQL without locking?

The best way to backfill millions of rows is using batch update strategies that process data in small chunks. This avoids long-running table locks in PostgreSQL and MySQL, ensuring continuous user traffic during data migration.

How do I safely rollback a database schema change in production?

Safely rollback a database schema change by following pre-migration safety checklists and established rollback procedures. This skill provides production guardrails and anti-pattern guidance to prevent common migration failures during reversals.

When do I need to use an expand-contract workflow for database migrations?

You need to use an expand-contract workflow when altering large production tables to avoid disrupting user traffic. It allows you to safely expand the schema first, migrate application code, and then contract by removing deprecated columns.