migrations

Create reversible Laravel migrations with up() and down() methods.

3|Updated Feb 13, 2026
One-click install
npx skills add https://github.com/codebar-ag/coding-guidelines --skill migrations-codebar-ag
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migrations
Source: https://github.com/codebar-ag/coding-guidelines/tree/main/resources/boost/skills/migrations
Command: npx skills add https://github.com/codebar-ag/coding-guidelines --skill migrations-codebar-ag

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Database migrations provide a disciplined approach to evolving the schema of a Laravel application, ensuring changes are traceable, reversible, and isolated from app logic.

Core Features & Use Cases

  • Create new migrations for every schema change and avoid modifying existing files.
  • Use descriptive names and proper foreign key constraints to improve readability and reliability.
  • Ensure each migration implements both up() and down() methods to allow clean rollbacks.

Quick Start

Create a new migration with a descriptive name and implement reversible up() and down() methods.

Frequently Asked Questions about migrations

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

FAQPage Schema
How do I create safe Laravel migrations for database schema changes?

Safe Laravel migrations require creating new files for every schema change, using descriptive names, and implementing both up() and down() methods to ensure controlled reversibility across environments.

What's the best way to ensure my database migrations are reversible?

To ensure database migrations are reversible, implement both up() and down() methods in every Laravel migration file, allowing clean rollbacks by undoing schema modifications like adding foreign keys or indexes.

Why should I avoid modifying existing Laravel migration files?

Modifying existing Laravel migration files breaks schema consistency across environments. You should always create new migrations for schema changes to maintain a traceable, reliable, and isolated database evolution history.

How do I add foreign key constraints and indexing in Laravel migrations?

Add foreign key constraints and indexing within your migration's up() method using Laravel schema builders, ensuring reliable relational integrity and improved query performance across your database.

Does this approach work for rolling back complex database schema updates in PHP?

Yes, this approach works for rolling back complex database schema updates in PHP by enforcing logical grouping and proper down() methods, ensuring reliable rollback capabilities for any Laravel schema evolution.