Agent skill · Databases

database-migrations

Database migration best practices for schema changes, data migrations, rollbacks, and zero-downtime deployments across PostgreSQL, MySQL, and common ORMs (Prisma, Drizzle, Kysely, Django, TypeORM, golang-migrate).

mturacgithub.com/mturacGitHub ↗
codexcopilotcursorMIT
Install
npx skills add mturac/everything-openai-codex --skill database-migrations --agent codex

Same command for any agent — swap --agent for claude-code, cursor, copilot.

Facts
Files in the skill folder: 1
SKILL.md size: 12 KB
Bundled scripts: none
Path: skills/database-migrations/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 84
Language: JavaScript

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the 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 ## Migration Safety Checklist Before applying any migration: - [ ] Migration has both UP and DOWN (or is explicitly marked irreversible) - [ ] No full table locks on large tables (use concurrent operations) - [ ] New columns have defaults or are nullable (never add NOT NULL without default) - [ ] Indexes created concurrently (not inline with CREATE TABLE for existing tables) - [ ] Data backf

What's inside
Steps it walks through
  1. When to Activate
  2. Core Principles
  3. Migration Safety Checklist
  4. PostgreSQL Patterns
  5. Adding a Column Safely
  6. Adding an Index Without Downtime
  7. Renaming a Column (Zero-Downtime)
  8. Removing a Column Safely
  9. Large Data Migrations
  10. Prisma (TypeScript/Node.js)
  11. Workflow
  12. Schema Example
  13. Custom SQL Migration
  14. Drizzle (TypeScript/Node.js)
Commands it runs
Create migration from schema changes
npx prisma migrate dev --name add_user_avatar
Apply pending migrations in production
npx prisma migrate deploy
Reset database (dev only)
npx prisma migrate reset
Generate client after schema changes
npx prisma generate
Create empty migration, then edit the SQL manually
npx prisma migrate dev --create-only --name add_email_index
More from everything-openai-codex
All skills →
About this skill
What does the database-migrations skill do?

Database migration best practices for schema changes, data migrations, rollbacks, and zero-downtime deployments across PostgreSQL, MySQL, and common ORMs (Prisma, Drizzle, Kysely, Django, TypeORM, golang-migrate).

How do I install it?

Run `npx skills add mturac/everything-openai-codex --skill database-migrations --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From mturac/everything-openai-codex, a repository with 84 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going