lc:consolidate-migrations

Consolidate fragmented Laravel migration files by grouping operations per table.

12|2|Updated Apr 8, 2026
One-click install
npx skills add https://github.com/edulazaro/laraclaude --skill lc-consolidate-migrations
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lc:consolidate-migrations
Source: https://github.com/edulazaro/laraclaude/tree/main/skills/consolidate-migrations
Command: npx skills add https://github.com/edulazaro/laraclaude --skill lc-consolidate-migrations

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the technical debt caused by hundreds of small, incremental migration files in Laravel projects, which can make database schema management difficult and error-prone.

Core Features & Use Cases

  • Migration Consolidation: Merges multiple incremental ALTER migrations into a single, clean CREATE migration.
  • Dependency Analysis: Automatically detects foreign key relationships and table dependencies to ensure safe merging.
  • Safety Guardrails: Provides dry-run modes and explicit confirmation steps to prevent accidental data loss or production schema conflicts.

Quick Start

Run the consolidate migrations skill to analyze all database migrations and report which tables can be safely merged.

Frequently Asked Questions about lc:consolidate-migrations

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

FAQPage Schema
How do I consolidate fragmented Laravel migrations into a single schema file?

To consolidate fragmented Laravel migrations, this skill analyzes your database/migrations directory, groups operations by table, and merges multiple incremental ALTER migrations into a single clean CREATE migration file.

What is the best way to clean up hundreds of small Laravel migration files?

The best way to clean up hundreds of small Laravel migration files is to group operations by table and detect foreign key dependencies, safely merging them while preserving data migrations and ensuring syntax validity.

Does consolidating Laravel migrations detect foreign key dependencies automatically?

Yes, consolidating Laravel migrations detects foreign key relationships and table dependencies automatically to ensure safe merging and prevent production schema conflicts during the refactoring process.

Can I run a dry-run before merging my Laravel database schema migrations?

Yes, you can run a dry-run before merging Laravel database schema migrations. The skill provides dry-run modes and explicit confirmation steps to prevent accidental data loss during schema optimization.

What do I need to validate syntax when refactoring Laravel migrations?

To validate syntax when refactoring Laravel migrations, you need read access to migration files and bash execution capabilities to run php -l, ensuring the consolidated schema definitions remain syntactically valid.

When should I not use automated migration consolidation in Laravel?

You should not use automated migration consolidation in Laravel for data migrations, as the skill specifically preserves them, or in production environments without first utilizing the provided dry-run modes and confirmation steps.