database-migration

Execute database migrations across ORMs and platforms with zero-downtime strategies, data transformation, and rollback procedures. Use when migrating databases, changing schemas, performing data transformations, or implementing zero-downtime deployment strategies.

Author

Install

Hot:0

Download and extract to your skills directory

Copy command and send to OpenClaw for auto-install:

Download and install this skill https://openskills.cc/api/download?slug=sickn33-skills-database-migration&locale=en&source=copy

Database Migration - Cross-ORM Database Migration and Zero-Downtime Deployment Tool

Skill Overview


Database Migration is a professional database migration assistant that helps developers perform table structure changes, data transformations, and zero-downtime deployments across ORM frameworks (Sequelize, TypeORM, Prisma). It provides complete migration scripts and rollback strategies.

Applicable Scenarios

1. ORM Framework Switching and Migration


When you need to migrate from Sequelize to TypeORM, or switch from Prisma to another ORM, this skill provides complete migration script templates and cross-database compatibility solutions to ensure data safety and integrity.

2. Production Zero-Downtime Deployment


When you need to change database table structures without interrupting service, it provides zero-downtime migration strategies such as blue-green deployment and expandable fields, supporting smooth rolling upgrades.

3. Complex Data Transformation and Refactoring


When you need to split fields, merge tables, change data types, or perform large-scale data transformations, it offers a complete migration process with transaction protection, backup recovery, and validation checks.

Core Features

1. Multi-ORM Migration Script Generation


Automatically generates migration script templates for the three major ORMs—Sequelize, TypeORM, and Prisma—including up/down bidirectional migration logic, and supports common operations such as creating/dropping/modifying tables, index management, and foreign key constraints.

2. Zero-Downtime Migration Strategies


Provides production-grade solutions like blue-green deployment, expandable fields, and multi-stage progressive migration to ensure old and new code can run concurrently and enable seamless upgrades.

3. Complete Rollback and Validation Mechanisms


Each migration comes with executable rollback scripts, supports transaction protection and backup table recovery, and provides migration validation checkpoints to ensure safe rollback in case of failures.

Frequently Asked Questions

What if a database migration fails?


This skill provides a corresponding down rollback script for every migration. Execute npx sequelize-cli db:migrate:undo or npm run typeorm migration:revert to rollback. For complex migrations, it also offers backup table recovery and transaction protection mechanisms.

How to achieve zero-downtime database migration?


Zero-downtime migration uses a multi-stage strategy: first add new fields (compatible with old code), deploy dual-write code, backfill historical data, switch read operations to the new fields, and finally remove the old fields. This skill provides complete blue-green deployment templates and step-by-step migration scripts.

What are the differences between Sequelize and TypeORM migrations?


Their migration syntax and execution differ: Sequelize uses the queryInterface API, TypeORM uses QueryRunner, and Prisma generates migrations based on schema.prisma. This skill provides corresponding migration templates and best practice guides for all three ORMs.