database-change-management

Plan and implement reversible Laravel/Eloquent database schema migrations with backfills.

1|Updated Dec 14, 2025
One-click install
npx skills add https://github.com/mgkyawzayya/claude-code-usage-flow --skill database-change-management
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-change-management
Source: https://github.com/mgkyawzayya/claude-code-usage-flow/tree/main/.claude/skills/database-change-management
Command: npx skills add https://github.com/mgkyawzayya/claude-code-usage-flow --skill database-change-management

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Safely evolving database schemas without risking downtime or data loss, with reversible migrations and backfills.

Core Features & Use Cases

  • Migration patterns: Safe add/drop columns, indexing, zero-downtime strategy.
  • Eloquent backfills: Chunked updates for large datasets.
  • Documentation tie-in: Update models and relationships.

Quick Start

Create a migration to add a nullable field, backfill data in chunks, then make the field non-null with a separate migration.

Frequently Asked Questions about database-change-management

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

FAQPage Schema
How do I safely add columns to a Laravel database without causing downtime?

Safe column addition uses reversible migrations with nullable fields, chunked backfills, and a separate migration to enforce constraints. Plan the migration, run it in staging, verify with rollback and re-migrate, then deploy with tests.

What's the best way to backfill large datasets during database migrations?

Chunked backfills process data in batches to avoid memory overload and locking. Use Eloquent's chunked update pattern within a migration or separate script, then verify data integrity before applying non-null constraints.

How do I create database indexes safely in a production Laravel application?

Indexing migrations should be reversible with down() methods and tested in staging first. Plan index creation alongside schema changes, verify performance impact, and document the deployment order for zero-downtime application.

Why should database migrations include a down() method?

Reversible migrations enable rollback if deployment fails, allowing quick recovery without data loss. The mandatory verify loop—migrate, rollback, migrate, test—ensures migrations work both forward and backward before production deployment.

Can I use this approach with Eloquent relationships and model updates?

Yes. Migration patterns cover relationship adjustments and model documentation updates alongside schema changes. Backfill scripts use Eloquent for chunked updates, keeping your ORM layer consistent throughout the migration process.

What precautions prevent data loss during schema evolution?

Document all required backfills, enforce deployment order, use staging verification loops, and plan zero-downtime strategies for large tables. Reversible migrations with comprehensive testing catch issues before production impact.