database-migration

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

Updated Mar 12, 2026
One-click install
npx skills add https://github.com/RavitejaKarra24/dotfiles --skill database-migration-ravitejakarra24
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-migration
Source: https://github.com/RavitejaKarra24/dotfiles/tree/main/agents/.agents/skills/database-migration
Command: npx skills add https://github.com/RavitejaKarra24/dotfiles --skill database-migration-ravitejakarra24

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Changing database schemas or moving data in production is risky: a failed migration can corrupt data or cause downtime. This Skill provides tested migration patterns for Sequelize, TypeORM, and Prisma, including rollback procedures and zero-downtime deployment strategies. ## Core Features & Use Cases - ORM Migration Templates: Ready-to-use up/down migration code for Sequelize, TypeORM, and Prisma covering table creation, column changes, and type conversions. - Rollback & Safety Strategies: Transaction-based migrations, checkpoint backups, and verification steps that restore data automatically on failure. - Zero-Downtime Patterns: Multi-phase blue-green style migrations (add column, backfill, switch reads, drop old column) for live production systems. - Use Case: You need to rename a name column to full_name on a live users table. The Skill walks you through adding the new column, backfilling data, deploying code, and dropping the old column without downtime. ## Quick Start Ask the agent to write a zero-downtime Sequelize migration that renames the email column on the users table with a rollback plan.

Frequently Asked Questions about database-migration

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

FAQPage Schema
How do I write a database migration in Sequelize?

Create a migration file exporting up and down functions that receive queryInterface and Sequelize. Use queryInterface.createTable, addColumn, or removeColumn inside up, reverse the operations in down, then run npx sequelize-cli db:migrate and db:migrate:undo to roll back.

How to rename a column in production without downtime?

Use a multi-step approach: add the new column, backfill data from the old column, deploy code that reads the new column, then drop the old column in a later migration. Each step stays backward compatible so old and new code coexist.

Sequelize vs TypeORM vs Prisma for migrations?

Sequelize and TypeORM use explicit up/down migration classes giving full control over rollback logic. Prisma generates migrations from schema.prisma diffs via prisma migrate dev, which is simpler but offers less custom rollback control.

How do I roll back a failed database migration?

Wrap changes in a transaction so failures roll back automatically, or create a backup table before migrating and restore from it if verification fails. Each migration should also define a down function reversing the up operations.

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 on PostgreSQL and JSON on MySQL when creating the same table.