This plugin exports a MySQL Workbench model to Laravel migrations. It generates migration files for Laravel projects based on the schema defined in MySQL Workbench. The plugin supports various MySQL data types and converts them to their corresponding Laravel migration types.
- Converts MySQL schema to Laravel migration files.
- Supports multiple schemas.
- Supports various MySQL data types and maps them to Laravel types.
- Handles foreign keys, indexes, timestamps, and polymorphic relationships.
- Generates migration files with proper naming conventions.
- Provides a wizard interface for reviewing and saving generated migrations.
- Topological sorting of tables to handle foreign key dependencies.
- Clone this repository.
- Open MySQL Workbench.
- Navigate to "Scripting" > "Install Plugin/Module...".
- Select the
laravel-migrations.py
file. - Follow the prompts to complete the installation.
Now you're ready to start exporting your MySQL Workbench models to Laravel migrations! 🚀
- Open MySQL Workbench and create a database model.
- Add tables, columns, indexes, and foreign keys to the model.
- Go to "Tools" -> "Catalog" -> "Export Laravel Migration".
- Review the generated Laravel migration files for the schema.
- Save the migration files to the desired location.
- Click next if you have more than one schema and repeat the last two steps.
- Copy the migration files to the Laravel project's "database/migrations" folder.
- Run
php artisan migrate
to apply the migrations to the database.
- MySQL Workbench 8.0 or higher
- MySQL database model
- Laravel 8.x or higher
- PHP 7.3 or higher
Lucas Martins
0.9
2025-02-08
MIT