database_migration

Execute schema and data migrations across ORMs with rollback and zero-downtime strategies.

Updated Jan 14, 2026
One-click install
npx skills add https://github.com/jvsandhu/agentic-skills --skill database-migration-jvsandhu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database_migration
Source: https://github.com/jvsandhu/agentic-skills/tree/main/skills/database_migration
Command: npx skills add https://github.com/jvsandhu/agentic-skills --skill database-migration-jvsandhu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve? Changing database schemas or moving data between databases is risky: a failed migration can lock tables, corrupt data, or cause downtime. This Skill provides proven migration patterns for Sequelize, TypeORM, and Prisma, including rollback procedures and zero-downtime expand-contract strategies. ## Core Features & Use Cases - ORM Migration Patterns: Ready-to-use migration templates for Sequelize, TypeORM, and Prisma covering table creation, column changes, and type conversions. - Rollback & Safety: Transaction-based migrations, checkpoint backups, and verification steps so failed migrations can be safely reverted. - Zero-Downtime Deployments: Expand-contract (blue-green) strategies that keep old and new code working during schema transitions. - Use Case: You need to rename a heavily used column in production. Follow the multi-step pattern: add the new column, backfill data in batches, deploy code reading the new column, then drop the old one—without any downtime. ## Quick Start Use the database migration skill to create a zero-downtime migration that renames the users.name column to full_name with a rollback script.

Frequently Asked Questions about database_migration

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

FAQPage Schema
How do I rename a database column without downtime?

Use the expand-contract pattern: add the new column, deploy code writing to both columns, backfill existing data in batches, switch reads to the new column, then drop the old column. Each step is a separate backward-compatible migration.

How to write a rollback for a Sequelize migration?

Every Sequelize migration defines an up function and a down function that reverses it, such as dropping a created table or removing an added column. Run npx sequelize-cli db:migrate:undo to execute the rollback.

Sequelize vs TypeORM vs Prisma for migrations?

Sequelize and TypeORM use imperative JavaScript/TypeScript migration files with explicit up and down methods. Prisma generates migrations declaratively from schema.prisma changes via prisma migrate dev, which is simpler but offers less manual control.

Can migrations handle differences between PostgreSQL and MySQL?

Yes, detect the dialect with queryInterface.sequelize.getDialect() and branch the migration logic, for example using JSONB columns for PostgreSQL and JSON for MySQL. This keeps one migration file compatible across databases.

What should I do before running a production migration?

Take a full database backup or verify Point-in-Time Recovery, estimate lock duration based on table size, and prepare a tested down script. Verify schema integrity afterward and check for drift between the migration files and the actual database schema.