database-migration

Create and review reversible database migration scripts with rollback logic.

6|1|Updated Mar 30, 2026
One-click install
npx skills add https://github.com/wesleyosantos91/multi-agents --skill database-migration-wesleyosantos91
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-migration
Source: https://github.com/wesleyosantos91/multi-agents/tree/main/devin/.devin/skills/database-migration
Command: npx skills add https://github.com/wesleyosantos91/multi-agents --skill database-migration-wesleyosantos91

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you create and review database migrations that reduce production risk by ensuring reversibility, minimizing locking, and making data backfills safer.

Core Features & Use Cases

  • Reversible migrations with rollback: Always includes a DOWN/rollback path and guidance to test it in staging.
  • Zero-downtime migration strategies: Recommends safe patterns to avoid locking and handles risky operations (like renames and drops) with expand-and-contract approaches.
  • Safe backfill practices: Encourages batched updates, lock/performance awareness, and staging validation for large tables.

Quick Start

Ask the Skill to generate a reversible migration for adding a new nullable column to the orders table and include 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 script with a reliable rollback path?

A reliable database migration script requires explicit UP and DOWN logic to ensure reversibility. You should always test the rollback path in staging before applying schema changes to production.

What is the expand-and-contract pattern for zero-downtime schema changes?

The expand-and-contract pattern handles backward-incompatible transformations by splitting them into separate deployments. It expands the schema first, migrates data, and then contracts by removing old columns.

How do I safely backfill data in large production tables?

Safe data backfill in large tables requires batched updates to minimize locking and maintain performance. You should validate the batch update process in staging before executing it against production data.

How can I add a database index without locking the table?

Adding indexes without locking requires following zero-downtime practices that avoid unsafe locking operations. You should generate migration scripts that explicitly validate lock duration and performance impact.

When should I avoid dropping a column in a database migration?

You should avoid dropping a column immediately after schema changes because it breaks backward compatibility. Use expand-and-contract approaches to delay the drop until all dependent application code is updated.

What's the best way to validate a database migration before deploying to production?

The best way to validate a database migration is using a checklist-driven approach to verify zero-downtime compliance and rollback behavior. You must test the explicit UP and DOWN logic in staging first.