database-migrations

Plan reversible, tested database migrations for PostgreSQL and MySQL.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/luongldptit/move-ticket --skill database-migrations-luongldptit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-migrations
Source: https://github.com/luongldptit/move-ticket/tree/main/.agent/skills/database-migrations
Command: npx skills add https://github.com/luongldptit/move-ticket --skill database-migrations-luongldptit

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill eliminates the risk of production outages, data loss, and service downtime caused by unsafe, unplanned, or manual database schema and data changes.

Core Features & Use Cases

  • Zero-Downtime Schema Changes: Implements expand-contract patterns and safe DDL operations for PostgreSQL and MySQL to avoid table locks and service interruptions during schema updates.
  • Safe Data Migrations: Provides batched backfill workflows and enforces separation of DDL and DML operations to prevent long-running transactions that lock large production tables.
  • Cross-ORM Standardization: Includes tooling guidance and code examples for Prisma, Drizzle, Kysely, Django, and golang-migrate to unify migration workflows across different tech stacks.
  • Real-World Use Case: For a SaaS platform adding a new required user profile field, this skill guides you to add the nullable column first, backfill existing records in a separate batched migration, deploy application code updates to use the new field, then drop the old field in a later migration, all without any user-facing downtime.

Quick Start

Use the database-migrations skill to create a zero-downtime migration plan for adding a non-null email column to your existing 10 million row 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 run zero-downtime database migrations on a large PostgreSQL table?

Zero-downtime database migrations on PostgreSQL use expand-contract patterns and concurrent index creation to avoid table locks. Batched data backfills and separate DDL/DML operations prevent long-running transactions from blocking service availability during schema updates.

What is the expand-contract pattern for schema changes?

The expand-contract pattern for schema changes involves adding new nullable columns first, backfilling existing data in batches, deploying application code to use the new field, and dropping the old column later. This prevents table locks and data inconsistency during zero-downtime deployments.

Can I use Prisma or Django for safe data backfills in production?

Prisma and Django are supported for safe data backfills in production. The skill standardizes migration workflows across Prisma, Drizzle, Kysely, Django, and golang-migrate, enforcing batched backfills and separation of DDL and DML operations to prevent locking large production tables.

How do I add a non-null column to a 10 million row table without locking?

Adding a non-null column to a 10 million row table without locking requires adding the column as nullable first, then running a separate batched data backfill migration. Application code updates deploy next, followed by a later migration to enforce constraints, ensuring no user-facing downtime.

Why do I need to separate DDL and DML operations in database migrations?

Separating DDL and DML operations in database migrations prevents long-running transactions that lock large production tables. Combining schema alterations with data updates in a single transaction causes blocking; isolating them ensures safe, reversible, and zero-downtime deployment workflows.

Does golang-migrate support immutable production migration files?

golang-migrate supports immutable production migration files within this workflow. The skill enforces tested, reversible migration practices across PostgreSQL and MySQL environments, requiring immutable files and expand-contract patterns to meet zero-downtime deployment requirements safely.