Automatically generate Laravel migrations from an existing database schema, including indexes and foreign keys.
Laravel Migrations Generator is a Laravel package that automatically generates migration files from an existing database schema. It reads the structure of a database—including tables, columns, indexes, and foreign keys—and produces the corresponding Laravel migration code. This solves the problem of manually writing migrations for pre-existing databases, such as when inheriting a legacy project or needing to version-control a database that was created outside of Laravel's migration system.
Laravel developers working with existing databases, particularly those onboarding to legacy projects or needing to bring an existing database under migration control. It's also useful for teams that want to automate and standardize the process of generating migrations from database schemas.
Developers choose this package because it eliminates the tedious and error-prone manual process of writing migrations for existing database structures. It provides a reliable, automated way to generate Laravel-compatible migrations, ensuring consistency and saving significant development time compared to hand-coding each migration.
Laravel Migrations Generator: Automatically generate your migrations from an existing database schema.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Scans an existing database and generates Laravel migration files for tables, columns, indexes, and foreign keys, saving significant manual effort as highlighted in the README's philosophy.
Handles various data types including enums, booleans, blobs, and JSON, with proper mapping to Laravel migration methods, as noted in the 'Field Type Mapping' feature.
Allows generating migrations for specific tables or ignoring them via command-line options like --ignore, and supports non-default database connections for versatility.
Can add entries to the migrations table to mark generated migrations as already run, preventing duplicate execution in Laravel projects.
Relies on Way\Generators, which has been discontinued for Laravel 5, leading to potential maintenance issues and lack of updates for newer Laravel versions.
README primarily supports up to Laravel 5.4, with notes on compatibility challenges, making it less suitable for modern Laravel projects without manual fixes.
Changelog reveals past issues with enum handling, foreign key names, and JSON column mapping, indicating potential unreliability in complex or edge-case schemas.
Requires manual service provider registration in older Laravel versions and careful environment setup, which can be error-prone and time-consuming.