This covers the full lifecycle of database schema changes: safe column additions, concurrent index creation, zero-downtime renames using expand-contract, and batched data migrations that won't lock your tables. It includes patterns for PostgreSQL, MySQL, and five ORMs (Prisma, Drizzle, Kysely, Django, TypeORM, golang-migrate) with real migration file examples. The safety checklist alone is worth having open when you're about to add a NOT NULL column to a 50 million row table at 2pm on a Tuesday. Best for teams that have been bitten by a full table rewrite in production and want the playbook to never let it happen again.

skills.sh installs
5.9K
GitHub stars
229.1K
last updated
Jul 14, 2026

Install

$ npx -y skills add affaan-m/everything-claude-code --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/everything-claude-code
Categories
Backend & APIs, Databases

More from affaan-m/everything-claude-code

All 256
1recoupable avatarrecoup-platform-api-accessrecoupable/skillsCall the Recoup API and external connectors directly — fetch any platform resource (artists, socials, organizations, research, documents) and run connector acti5.3Kskills.sh installs
2firebase avatarfirebase-local-env-setupfirebase/agent-skillsBare minimum INITIAL setup for getting started with Firebase (Node.js, CLI installation, first-time login). Use ONLY for first-time setup. For updating, trouble5.1Kskills.sh installs
3yaklang avatarssrf-server-side-request-forgeryyaklang/hack-skillsSSRF playbook. Use when the server fetches URLs, resolves hostnames, imports remote content, or can be driven toward internal networks, cloud metadata, or secon4.1Kskills.sh installs
4yaklang avatarapi-recon-and-docsyaklang/hack-skillsAPI reconnaissance and documentation review playbook. Use when discovering endpoints, schemas, versions, OpenAPI specs, hidden docs, and surface area for API te4Kskills.sh installs
5yaklang avatargraphql-and-hidden-parametersyaklang/hack-skillsGraphQL and hidden parameter testing playbook. Use when exploring introspection, batching, undocumented fields, hidden parameters, schema abuse, and GraphQL aut3.8Kskills.sh installs
6sickn33 avatarprisma-expertsickn33/antigravity-awesome-skillsprisma expert3.8Kskills.sh installs