skill-database-migration

Guide safe database migrations across Prisma, TypeORM, Alembic, and Flyway.

4|Updated Mar 31, 2026
One-click install
npx skills add https://github.com/ryan-nguyen-01/agent-platform --skill skill-database-migration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: skill-database-migration
Source: https://github.com/ryan-nguyen-01/agent-platform/tree/main/.claude/skills/skill-database-migration
Command: npx skills add https://github.com/ryan-nguyen-01/agent-platform --skill skill-database-migration

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Best practices and practical patterns for applying database migrations across multiple tools (Prisma Migrate, TypeORM, Alembic, Flyway) with a focus on idempotence, rollback, small steps, and safe deployment workflows.

Core Features & Use Cases

  • Migration principles: ensure idempotent migrations, provide down migrations, avoid altering run migrations on shared environments, keep migrations small and focused, test on staging before production, back up databases, and order migration files properly.
  • Tool coverage: guidance for Prisma Migrate, TypeORM, Alembic, Flyway, and zero-downtime strategies like expand-contract and safe operations.
  • Use Case: a typical workflow where schema changes are introduced, migrations are generated, backfilled data done in separate scripts, and production rollout uses a expand-deploy-cleanup pattern.

Quick Start

Execute a Prisma migration to apply the schema changes in your development environment.

Frequently Asked Questions about skill-database-migration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I perform zero-downtime database migrations in production?

Zero-downtime database migrations use an expand-contract pattern, separating schema changes from data backfills into staged deployment workflows. This approach applies safe operations incrementally, ensuring production rollout proceeds without locking tables or interrupting active traffic.

What is the best way to manage rollback for database migrations?

Managing database migration rollbacks requires providing reliable down migrations and keeping migration steps small and focused. Testing on staging before production and backing up databases ensures you can safely revert schema changes if deployment encounters issues.

Does this database migration guidance work with Prisma, Alembic, TypeORM, and Flyway?

Yes, this database migration guidance covers Prisma Migrate, Alembic, TypeORM, and Flyway. It provides tool-specific scope and end-to-end workflows for applying safe schema changes across these popular frameworks.

How do I handle data backfill during a schema migration?

Data backfill during schema migrations should be handled in separate scripts, independent of the core schema changes. The deployment workflow uses an expand-deploy-cleanup pattern, applying backfills safely before completing the final rollout phase.

Why should I keep database migrations idempotent and avoid altering shared environments?

Idempotent database migrations ensure consistent execution across environments without unintended side effects. Avoiding altering already-run migrations on shared environments prevents schema drift and maintains integrity across the deployment pipeline.