database-migrations

Generate safe Rails 8+ database migration patterns with rollback strategies.

3|Updated Oct 16, 2025
One-click install
npx skills add https://github.com/dchuk/source_monitor --skill database-migrations-dchuk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-migrations
Source: https://github.com/dchuk/source_monitor/tree/main/.claude/skills/database-migrations
Command: npx skills add https://github.com/dchuk/source_monitor --skill database-migrations-dchuk

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Creates robust database migration patterns for Rails 8+, ensuring zero-downtime, reversible changes, and safe indexing.

Core Features & Use Cases

  • Safe patterns for adding/removing columns, adding indexes concurrently, and handling backfills in batches.
  • Reversible migrations, data integrity constraints, and guardrails to prevent production downtime.
  • Real-world scenario: upgrading a users table with a new boolean flag while maintaining service availability.

Quick Start

Run a guided migration checklist to safely apply a non-blocking schema change in a production Rails app.

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 database column in Rails without downtime?

To add a database column without downtime in Rails, you must use zero-downtime migration patterns that deploy schema changes in safe batches. This approach ensures service availability by backfilling data incrementally and avoiding table locks.

What are zero-downtime migrations and how do they work?

Zero-downtime migrations are database schema changes that avoid locking tables or blocking application traffic. They work by applying reversible changes, adding indexes concurrently, and performing batched backfills to maintain continuous service availability.

How do I add a database index concurrently in Rails 8?

You add a database index concurrently in Rails 8 by applying safe migration patterns that enforce index creation without blocking database operations. This ensures data integrity and prevents production downtime during schema evolution.

Can I use these safe migration patterns for upgrading a large users table?

Yes, you can use safe migration patterns for upgrading a large users table, such as adding a new boolean flag. The process enforces data integrity checks and batched backfills to maintain service availability throughout the upgrade.

How do I rollback an unsafe database migration in Rails?

You rollback an unsafe database migration in Rails by enforcing reversible changes with built-in rollback strategies. These guardrails ensure that schema evolution and data modifications can be safely undone without losing data integrity.

What is the best way to handle data backfills during a schema change?

The best way to handle data backfills during a schema change is to process them in batches. Batched backfills prevent database locking and maintain data integrity, serving as a core component of zero-downtime Rails migrations.