database-migrations

Generate production-safe Rails and PostgreSQL migration plans with rollback checks.

1|Updated Jan 8, 2026
One-click install
npx skills add https://github.com/LaunchPadLab/ai-bank --skill database-migrations-launchpadlab
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-migrations
Source: https://github.com/LaunchPadLab/ai-bank/tree/main/claude/skills/database-migrations
Command: npx skills add https://github.com/LaunchPadLab/ai-bank --skill database-migrations-launchpadlab

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Database migrations can cause downtime, lock tables, break rollbacks, or corrupt data when changes aren’t structured with safety patterns.

Core Features & Use Cases

  • Production-safe migration patterns: guidance for reversible schema changes, zero-downtime index creation, and safe handling of large tables.
  • Guardrails for constraints and performance: checklists for reversibility, batching/backfills, concurrent indexes, and avoiding dangerous operations like direct column type changes.
  • Rails + PostgreSQL focused workflows: includes Rails 8 migration examples, index strategies, foreign key/index conventions for multi-tenancy, and strong_migrations usage.

Quick Start

Ask for a Rails 8 migration plan by saying: "Create an index on the events.status column using a production-safe, reversible Rails migration and include the appropriate checklist for safety."

Frequently Asked Questions about database-migrations

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a NOT NULL constraint to an existing PostgreSQL column without locking the table in Rails?

To safely add a NOT NULL constraint, use a two-step Rails migration: backfill existing rows first, then add the constraint in a separate migration to avoid locking the PostgreSQL table during the update.

What is the best way to create an index on a large PostgreSQL table without downtime?

Zero-downtime index creation requires using the `concurrent` option in Rails migrations, allowing PostgreSQL to build the index without blocking writes or acquiring an exclusive table lock.

How do I backfill data in Rails migrations without causing performance issues?

Backfill data in batches using Rails migration patterns to prevent long-running table locks, ensuring updates process in smaller chunks rather than a single large query on PostgreSQL.

Does strong_migrations help catch dangerous column type changes in PostgreSQL?

Yes, strong_migrations aligns with safe Rails patterns by detecting dangerous operations like direct column type changes, preventing irreversible schema modifications and table locks in PostgreSQL.

How do I ensure a Rails database migration is reversible?

Ensure Rails migration reversibility by writing both `up` and `down` methods or using reversible code blocks, applying safe patterns for schema changes, index creation, and data backfills.

When do I need concurrent index creation in PostgreSQL?

Concurrent index creation is needed when adding indexes to large PostgreSQL tables in production environments to prevent table locks and avoid downtime during the migration process.