database-migration

Execute schema and data migrations across Sequelize, TypeORM, and Prisma with rollback strategies.

Updated Apr 23, 2026
One-click install
npx skills add https://github.com/SanketAdlak/PDMProjectDesign --skill database-migration-sanketadlak
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-migration
Source: https://github.com/SanketAdlak/PDMProjectDesign/tree/main/.agents/skills/database-migration
Command: npx skills add https://github.com/SanketAdlak/PDMProjectDesign --skill database-migration-sanketadlak

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Changing database schemas and transforming data in production is risky: a failed migration can corrupt data or cause downtime. This Skill provides proven migration patterns for popular ORMs, including rollback procedures and zero-downtime deployment strategies, so schema changes ship safely. ## Core Features & Use Cases - ORM Migration Templates: Ready-to-use migration code for Sequelize, TypeORM, and Prisma covering table creation, column changes, and type conversions. - Rollback & Recovery Strategies: Transaction-based migrations and checkpoint-based backups that restore data automatically when verification fails. - Zero-Downtime Patterns: Multi-phase blue-green migration workflows (add column, backfill, switch reads, drop old column) for live production systems. - Use Case: You need to rename a heavily used email column on a production users table without downtime. Follow the phased approach: add the new column, dual-write from the application, backfill existing rows, then drop the old column. ## Quick Start Use the database-migration skill to write a Sequelize migration that renames the users.name column to full_name with zero downtime and a rollback path.

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?

Rename a column with zero downtime using a multi-phase approach: add the new column, deploy code that writes to both columns, backfill existing data, switch reads to the new column, then drop the old one. Never rename directly on a live production table.

How to write a rollback for a Sequelize migration?

Implement the down function in every Sequelize migration to reverse the up operation, such as dropping a created table or removing an added column. Run npx sequelize-cli db:migrate:undo to execute the rollback for the most recent migration.

Sequelize vs TypeORM vs Prisma for database migrations?

Sequelize uses JavaScript migration files with up/down functions, TypeORM uses TypeScript classes implementing MigrationInterface, and Prisma generates migrations automatically from schema.prisma changes. Choose based on your existing ORM and whether you prefer code-first or schema-first workflows.

Can I migrate data between PostgreSQL and MySQL?

Yes, but handle dialect differences explicitly, such as using JSONB for PostgreSQL and JSON for MySQL. Check the active dialect with queryInterface.sequelize.getDialect() and branch your migration logic accordingly.

What happens if a database migration fails halfway?

Wrap migration steps in a transaction so failures trigger an automatic rollback to the pre-migration state. For large data changes, use checkpoint-based backups that create a backup table and restore from it if verification fails.