百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
M

migrations-generator

> 编程语言
开源

Laravel 迁移生成器: 从现有数据库结构自动生成迁移。

360 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

Laravel 迁移生成器: 从现有数据库结构自动生成迁移。

Laravel Migrations Generator Laravel 5/6/7/8/9/10/11/12

Generate Laravel Migrations from an existing database, including indexes and foreign keys!

Versioning & compatibility

Branch / Tag Laravel support PHP support Notes
laravel-12.x (12.0.0) 12.x >= 8.3 Uses doctrine/dbal:^4.0 to match the Laravel 12 / Carbon 3 ecosystem.
laravel-11.x (11.0.0) 11.x >= 8.2 Use ^11.0 for Laravel 11 apps.
laravel-10.x (10.0.0) 10.x >= 8.1 Use ^10.0 for Laravel 10 apps.
laravel-9.x (9.0.0) 9.x >= 8.2 Use ^9.0 to stay on the Laravel 9-compatible line.
Legacy 2.x (2.0.24) 5.x – 8.x ^5.6 || ^7.0 || ^8.0 Last release for older apps (ships with the legacy generator dependency).

Each Laravel major has its own maintenance branch/tag series (e.g. laravel-12.x -> 12.y.z). See doc/versions.md for the full compatibility matrix.

Contact

https://t.me/h0rnero

Laravel 6/7/8/9/10/11/12 installation

The recommended way to install this is through composer:

bash
composer require oscarafdev/migrations-generator --dev

For Laravel 12, the 12.x line now targets doctrine/dbal:^4.0, which aligns with the Carbon 3 dependency tree used by that ecosystem.

In Laravel 5.5+ the service providers will automatically get registered.

Usage

To generate migrations from a database, you need to have your database setup in Laravel's Config.

Run php artisan migrate:generate to create migrations for all the tables, or you can specify the tables you wish to generate using php artisan migrate:generate table1,table2,table3,table4,table5. You can also ignore tables with --ignore="table3,table4,table5"

Laravel Migrations Generator will first generate all the tables, columns and indexes, and afterwards setup all the foreign key constraints. So make sure you include all the tables listed in the foreign keys so that they are present when the foreign keys are created.

You can also specify the connection name if you are not using your default connection with --connection="connection_name"

Run php artisan help migrate:generate for a list of options.

Check out Chung Tran's blog post for a quick step by step introduction: Generate Migrations from an existing database in Laravel 4

Changelog

Changelog for Laravel Migrations Generator

Jan 2021: v2.0.24

  • Support for Laravel 8
  • Fixed a issue where double single quotes were generated

Ago 2020: v2.0.23

  • Added support for precisions in timestamp.
  • Fixed an issue with the text type.
  • Fixed other reported bugs

May 2020: v2.0.19

  • Support for Laravel 7

Thank You

Thanks to Jeffrey Way for his amazing Laravel-4-Generators package. This package depends greatly on his work.

Contributors

Bernhard Breytenbach (@BBreyten)

Oscar Fernandez (@oscarafdev)

[email protected]

License

The Laravel Migrations Generator is open-sourced software licensed under the MIT license

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

PHP

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言