
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-codeInstalls 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
- Every change is a migration — never alter production databases manually
- Migrations are forward-only in production — rollbacks use new forward migrations
- Schema and data migrations are separate — never mix DDL and DML in one migration
- Test migrations against production-sized data — a migration that works on 100 rows may lock on 10M
- 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- Android Clean Architecture6.4K
- Prompt Optimizer6.3K
- Golang Patterns6.3K
- Postgres Patterns6.3K
- Verification Loop6.3K
- Article Writing6.3K
- Django Patterns6.2K
- Cpp Coding Standards6.2K
- Golang Testing6.2K
- Deep Research6.2K
- Java Coding Standards6.2K
- Blender Motion State Inspection6.1K
- Laravel Patterns6.1K
- Rust Patterns6.1K
- Springboot Patterns6.1K
- Context Budget6.1K
- Accessibility6.1K
- Nestjs Patterns6.1K
- Seo6.1K
- Django Security6.1K
- Git Workflow6K
- Python Testing6K
- Strategic Compact6K
- Design System6K