wshobson avatar

Database Migration

A comprehensive migration toolkit that handles schema changes, data transformations, and rollbacks across Sequelize, TypeORM, and Prisma. Shows you how to safely rename columns with zero downtime using the add-copy-drop pattern, implement transaction-based rollbacks, and handle complex data transformations with checkpoint backups. The examples cover real migration scenarios like changing column types on large tables and splitting address strings into separate fields. Most valuable when you need to evolve database schemas in production without breaking existing applications or losing data.

skills.sh installs
18K
GitHub stars
42.4K
last updated
Aug 21, 2026

Install

$ npx -y skills add wshobson/agents --skill database-migration --agent claude-code

Installs into .claude/skills of the current project.

Files

Database Migration

Master database schema and data migrations across ORMs (Sequelize, TypeORM, Prisma), including rollback strategies and zero-downtime deployments.

When to Use This Skill

  • Migrating between different ORMs
  • Performing schema transformations
  • Moving data between databases
  • Implementing rollback procedures
  • Zero-downtime deployments
  • Database version upgrades
  • Data model refactoring

ORM Migrations

Sequelize Migrations

// migrations/20231201-create-users.js
module.exports = {
  up: async (queryInterface, Sequelize) => {
    await queryInterface.createTable("users", {
      id: {
        type: Sequelize.INTEGER,
        primaryKey: true,
        autoIncrement: true,
      },
      email: {
        type: Sequelize.STRING,
        unique: true,
        allowNull: false,
      },
      createdAt: Sequelize.DATE,
      updatedAt: Sequelize.DATE,
    });
  },

  down: async (queryInterface, Sequelize) => {
    await queryInterface.dropTable("users");
  },
};

// Run: npx sequelize-cli db:migrate
// Rollback: npx sequelize-cli db:migrate:undo

TypeORM Migrations

Sponsors

Details

Repository
github.com/wshobson/agents
Categories
Backend & APIs, Databases

More from wshobson/agents

All 174
1github avatarpostgresql-code-reviewgithub/awesome-copilotPostgreSQL-specific code review assistant focusing on PostgreSQL best practices, anti-patterns, and unique quality standards. Covers JSONB operations, array usa12.8Kskills.sh installs
2elevenlabs avatarsetup-api-keyelevenlabs/skillsGuides users through setting up an ElevenLabs API key for ElevenLabs MCP tools. Use when the user needs to configure an ElevenLabs API key, when ElevenLabs tool11.9Kskills.sh installs
3github avataraspnet-minimal-api-openapigithub/awesome-copilotCreate ASP.NET Minimal API endpoints with proper OpenAPI documentation9.2Kskills.sh installs
4affaan-m avatarapi-designaffaan-m/everything-claude-codeapi design6.9Kskills.sh installs
5binance avataronchain-pay-open-apibinance/binance-skills-hubBinance Onchain Pay enables users to buy cryptocurrency with fiat (e.g., EUR, USD) or send existing crypto from their Binance account directly to any external o6Kskills.sh installs
6affaan-m avatarmysql-patternsaffaan-m/eccMySQL and MariaDB schema, query, indexing, transaction, replication, and connection-pool patterns for production backends.5.7Kskills.sh installs