Laravel Migration Generator

screenshot of Laravel Migration Generator

Generate migrations from existing database structures

Overview

The Laravel Migration Generator is a powerful tool designed for developers working with existing database structures. It offers an alternative method to the standard schema dump provided by Laravel, ensuring that tables are correctly represented in migrations, especially when using databases like SQLite, which lack certain functionalities. This tool is particularly beneficial for projects with a history of complex migrations or those without any migrations, allowing developers to automate the creation of migration files from their current database schema. This can simplify the process of managing database changes, making it easier to test and maintain applications.

With the latest version available on Packagist, this package streamlines the migration generation process. Whether you are looking to squash down existing database structures into manageable migrations or simply ensure consistency between your database and your application's design, the Laravel Migration Generator is an invaluable asset to your development toolkit.

Features

  • Seamless Integration: Easily generates migrations from existing database structures, perfect for teams looking to maintain synchronization between their database and application code.
  • SQLite Compatibility: Specifically designed to handle table alterations that SQLite doesn't support, making it essential for testing in that environment.
  • Custom Path Options: Migrations are by default placed in tests/database/migrations, but you have the flexibility to specify different paths via command options.
  • Environment Variable Setup: Supports environment variable configurations, allowing you to customize behaviors like automatic running of migrations after other migrations are completed.
  • Flexible Naming Schemes: Provides options to customize naming conventions for migration files, making it easier to adhere to your project's naming standards.
  • Skippable Features: Allows skipping designated tables and views during migration generation, enabling focused migrations based on project needs.
  • Clear Output Path Option: With an environment setting, you can clear the output path before creating new migration files, preventing clutter and confusion.
  • Sorting Modes: Offers a sorting mode based on foreign keys, ensuring that migrations maintain the intended structure and relationships in your database.