database-migrations

Installation
Summary

Safe, reversible database schema changes for production systems.

  • Covers PostgreSQL, MySQL, and five major ORMs (Prisma, Drizzle, Django, TypeORM, golang-migrate) with workflow examples and schema patterns for each
  • Enforces core principles: immutable deployed migrations, forward-only production rollbacks, and separation of schema (DDL) from data (DML) migrations
  • Provides the expand-contract pattern for zero-downtime column renames and large refactors, with concrete timeline examples
  • Includes safety checklist, anti-patterns table, and detailed PostgreSQL recipes for concurrent indexes, batched updates, and NOT NULL column additions without table locks
SKILL.md

Database Migration Patterns

Safe, reversible database schema changes for production systems.

When to Activate

  • Creating or altering database tables
  • Adding/removing columns or indexes
  • Running data migrations (backfill, transform)
  • Planning zero-downtime schema changes
  • Setting up migration tooling for a new project

Core Principles

  1. Every change is a migration — never alter production databases manually
  2. Migrations are forward-only in production — rollbacks use new forward migrations
  3. Schema and data migrations are separate — never mix DDL and DML in one migration
  4. Test migrations against production-sized data — a migration that works on 100 rows may lock on 10M
  5. Migrations are immutable once deployed — never edit a migration that has run in production
Related skills
Installs
4.1K
GitHub Stars
179.7K
First Seen
Feb 13, 2026