affaan-m avatar

Database Migrations

This is a comprehensive reference for production database migrations across Postgres, MySQL, and popular ORMs like Prisma, Drizzle, Kysely, Django, and TypeORM. It covers the critical stuff that bites you in production: zero-downtime column renames using expand-contract patterns, concurrent index creation to avoid table locks, batched updates for large tables, and the absolute rule that you never edit a migration after it runs. The safety checklist alone (nullable columns, separate schema and data migrations, testing against production-sized data) is worth having open during code review. Especially useful if you're moving from "just run ALTER TABLE" to proper migration discipline, or if you've been burned by a migration that worked fine in dev but locked your production table for twenty minutes.

skills.sh installs
6.4K
GitHub stars
300.3K
last updated
Aug 21, 2026

Install

$ npx -y skills add affaan-m/ecc --skill database-migrations --agent claude-code

Installs into .claude/skills of the current project.

Files

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

Migration Safety Checklist

Before applying any migration:

Sponsors

Details

Repository
github.com/affaan-m/ecc
Categories
Backend & APIs, Python, Go, Databases
First seen
Jul 14, 2026

More from affaan-m/ecc

All 263
1jeffallan avatardatabase-optimizerjeffallan/claude-skillsOptimizes database queries and improves performance across PostgreSQL and MySQL systems. Use when investigating slow queries, analyzing execution plans, or opti6.3Kskills.sh installs
2aws avataraws-lambda-microvmsaws/agent-toolkit-for-awsBuilds, runs, debugs, and operates applications on AWS Lambda MicroVMs — Firecracker-isolated, snapshot-resumable serverless compute environments running inside6.1Kskills.sh installs
3qianwen-ai avatarqianwen-ops-authqianwen-ai/qianwen-ai[QianWen] Configure authentication (API keys, endpoints). TRIGGER when: setting up QIANWEN_API_KEY, troubleshooting 401/auth errors, when another skill reports 5.8Kskills.sh installs
4trailofbits avatarfirebase-apk-scannertrailofbits/skillsScans Android APKs for Firebase security misconfigurations including open databases, storage buckets, authentication issues, and exposed cloud functions. Use wh5.8Kskills.sh installs
5manaflow-ai avatarcmux-backendmanaflow-ai/cmuxBackend TypeScript and Cloud VM development rules for cmux. Use when editing web/app/api, web/services, backend scripts, Cloud VM lifecycle, provider integratio4.9Kskills.sh installs
6grafana avatardatabase-observabilitygrafana/skillsSet up Grafana Cloud Database Observability for MySQL and PostgreSQL — enables `pg_stat_statements` / Performance Schema, creates a least-privilege monitoring u4.6Kskills.sh installs