2

Migration Management

Comprehensive Laravel migration management with individual migration control, rollback capabilities, and detailed execution history tracking through an intuitive Filament interface.

Overview

Migration Manager Page

Execute individual migrations and track their status with real-time monitoring through our dedicated Migration Manager page.

  • Individual migration execution with confirmation
  • Individual rollback for last migration
  • Real-time status display (Pending/Executed)
  • File existence validation

Batch Operations

Handle multiple migrations efficiently with batch processing through header actions.

  • Run all pending migrations at once
  • Rollback last batch of migrations
  • Real-time status refresh
  • Confirmation modals for safety

Why Choose This Migration Management?

Safety First

Confirmation dialogs prevent accidents

Real-time Status

Live migration status tracking

Developer Friendly

Intuitive Filament interface

Key Features

Core Migration Features

Individual Execute

Run single migrations with confirmation

Safe Rollback

Rollback individual or batch migrations

Batch Processing

Run all pending migrations together

Status Tracking

Real-time migration status display

Advanced Capabilities

File Existence Validation

Automatically detect missing migration files and prevent execution errors

Migration History Tracking

Comprehensive history logging with execution details via MigrationHistory resource

Sync Migration History

Synchronize migration history between Laravel's table and CodeForge tracking

User Interface

Migration Dashboard

Executed Migrations Count Display
Pending Migrations Ready to Run
Total Migrations Complete Count
Migration History Separate Resource

Action Controls

Interactive Features

Migration Table

Sortable table with status badges

Confirmation Modals

Safe execution with confirmation dialogs

Live Notifications

Real-time success/error notifications

Safety Features

Multi-Layer Protection

Pre-Execution Checks:

  • Migration file existence validation
  • Status verification (pending/executed)
  • Confirmation modal requirements
  • Individual rollback dependency check

During Execution:

  • Real-time status monitoring
  • Detailed error logging
  • Loading states and feedback
  • Temporary file cleanup

Confirmation System

Multi-step confirmation process prevents accidental execution of operations:

1
Click Run/Rollback button for individual migration
2
Confirm operation in modal dialog with migration name
3
Receive real-time notification of success or failure

Batch Operations

Header Actions

Execute batch operations through the page header actions for efficient management.

Run All Pending

Execute all pending migrations in one operation with confirmation

Rollback Last Batch

Rollback the most recent batch of migrations safely

Refresh Status

Update migration status display in real-time

Safety Features

Built-in safety measures ensure batch operations are performed safely.

Confirmation Required

All batch operations require explicit confirmation before execution

Batch Validation

Validates last batch status before allowing rollback operations

Detailed Feedback

Comprehensive notifications with operation results and affected migrations

Available Commands

# Enhanced Migration Commands php artisan codeforge:migrate # Run with history logging php artisan codeforge:migrate --rollback # Rollback with tracking php artisan codeforge:migrate --step=3 # Rollback specific steps php artisan codeforge:migrate-history:sync # Sync migration history

Migration Manager Page:

  • • Individual migration execution
  • • Batch operations via header actions
  • • Real-time status display
  • • Confirmation modals for safety

History Tracking:

  • • MigrationHistory resource
  • • Execution timing and metrics
  • • User attribution tracking
  • • Sync commands for consistency

Migration History

MigrationHistory Resource

Dedicated Filament resource for comprehensive migration execution history tracking and analysis.

Tracked Information:

  • Migration file name and batch
  • Action type (migrate/rollback)
  • User who executed the migration
  • Execution timestamp and duration

Additional Details:

  • Success/failure status
  • Error messages (if any)
  • Environment information
  • Database connection details

History Visualization

Migration Timeline

Success
2024-01-15 14:30 john.doe 2.3s

2024_01_15_143000_create_users_table.php

Schema Update

Rollback Available
2024-01-15 14:25 jane.smith 5.1s

2024_01_15_142500_add_indexes_to_products.php

Search and Filter

Powerful search and filtering capabilities help you find specific migrations quickly:

Text Search

Search by migration name or content

Date Range

Filter by execution date

User Filter

Show migrations by specific user

Rollback System

Safe Rollback

Rollback migrations safely with data preservation and conflict detection.

Data Preservation
Dependency Checking
Backup Restoration
Integrity Verification

Rollback Options

Multiple rollback strategies to handle different scenarios.

Individual Migration

Rollback one migration if no dependencies exist

Last Batch

Rollback entire last batch via header action

Step-based

Use commands with --step parameter

Enhanced Commands

Use codeforge:migrate --rollback with logging

Rollback Safety Checks

Before performing any rollback operation, the system performs comprehensive safety checks:

Pre-Rollback Validation:

  • • Check migration execution status
  • • Verify migration file existence
  • • Analyze dependent migration order
  • • Validate rollback capability

Safety Features:

  • • Confirmation modal requirements
  • • Real-time status notifications
  • • Detailed error reporting
  • • Migration history tracking

Best Practices

Migration Development

Best Practices:

  • • Use the Migration Manager for individual control
  • • Test migrations in development first
  • • Always use confirmation dialogs
  • • Check file existence before operations
  • • Use MigrationHistory for tracking

Avoid:

  • • Running migrations without confirmation
  • • Ignoring dependency validation warnings
  • • Skipping migration status verification
  • • Rolling back without checking dependencies
  • • Operating on missing migration files

Production Deployment

Pre-Deployment Checklist

  • ✓ All migrations tested in staging environment
  • ✓ Database backup created and verified
  • ✓ Rollback plan documented and tested
  • ✓ Development environment coordinated

During Deployment

  • ✓ Monitor migration execution progress
  • ✓ Watch for performance impacts
  • ✓ Verify data integrity after completion
  • ✓ Test application functionality

Development Coordination

Documentation:

  • • Document schema changes clearly
  • • Record migration purposes
  • • Maintain deployment schedules
  • • Coordinate environment updates

Version Control:

  • • Keep migrations in version control
  • • Use meaningful commit messages
  • • Tag releases with migration info
  • • Track migration dependencies

Ready to Manage Migrations Efficiently?

The Migration Manager provides a comprehensive interface for safe database changes with individual control and batch operations.