database-migration

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

Updated Jul 9, 2026
One-click install
npx skills add https://github.com/octanutri-clin/octaclin --skill database-migration-octanutri-clin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-migration
Source: https://github.com/octanutri-clin/octaclin/tree/main/.agents/skills/database-migration
Command: npx skills add https://github.com/octanutri-clin/octaclin --skill database-migration-octanutri-clin

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Changing database schemas and transforming data in production is risky: a failed migration can cause downtime or data loss. This Skill provides proven 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 migration code for Sequelize, TypeORM, and Prisma covering table creation, column changes, and type conversions. - Rollback Strategies: Transaction-based migrations and checkpoint-based backups that restore data automatically when verification fails. - Zero-Downtime Patterns: Multi-phase blue-green style migrations (add column, backfill, switch reads, drop old column) for live systems. - Use Case: You need to rename a heavily used column in a production PostgreSQL database without taking the app offline. Follow the multi-step pattern: add the new column, backfill data, deploy code reading the new column, then drop the old one. ## Quick Start Ask the AI to write a zero-downtime TypeORM migration that renames the email column in 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 rename a database column 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 final migration. This keeps old and new application versions working throughout the rollout.

How to write a rollback for a failed database migration?

Wrap migration steps in a transaction so failures roll back automatically, or create a backup table with CREATE TABLE backup AS SELECT before changes and restore from it if verification fails. Every up migration should have a corresponding down migration.

Sequelize vs TypeORM vs Prisma for migrations?

Sequelize and TypeORM use explicit up/down migration files giving full control over schema changes and rollbacks. Prisma generates migrations from the schema file with prisma migrate dev, which is simpler but less flexible for complex data transformations.

Can I migrate data between PostgreSQL and MySQL?

Yes, but handle dialect differences explicitly, such as using JSONB for PostgreSQL and JSON for MySQL. Branch migration logic on the dialect detected from the query interface so each database gets compatible column types.

Why do migrations fail on large tables?

Changing column types or adding constraints on large tables can lock rows and time out. Use a multi-step approach: add a new column, backfill in batches, then swap columns, instead of altering the column in place.