> For the complete documentation index, see [llms.txt](https://devsb.gitbook.io/laranotes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://devsb.gitbook.io/laranotes/usefull-packages/migration-generator.md).

# Migration Generator

## Laravel Migrations Generator

![Style check CI](https://github.com/kitloong/laravel-migrations-generator/actions/workflows/check.yml/badge.svg?branch=5.x) [![codecov](https://codecov.io/gh/kitloong/laravel-migrations-generator/branch/5.x/graph/badge.svg?token=U6ZRDPY6QZ)](https://codecov.io/gh/kitloong/laravel-migrations-generator) ![Tests CI](https://github.com/kitloong/laravel-migrations-generator/actions/workflows/tests.yml/badge.svg?branch=5.x) [![Latest Stable Version](https://poser.pugx.org/kitloong/laravel-migrations-generator/v/stable.png)](https://packagist.org/packages/kitloong/laravel-migrations-generator) [![Total Downloads](http://poser.pugx.org/kitloong/laravel-migrations-generator/downloads)](https://packagist.org/packages/kitloong/laravel-migrations-generator) [![License](https://poser.pugx.org/kitloong/laravel-migrations-generator/license.png)](https://packagist.org/packages/kitloong/laravel-migrations-generator)

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

This package is cloned from <https://github.com/Xethron/migrations-generator> and updated to support Laravel 5.6 and above, with a lot of feature improvements.

### Supported Database

Currently, Generator support generate migrations from:

* [x] MySQL
* [x] PostgreSQL
* [x] SQL Server

### Version Compatibility

| Laravel       | Version                                           |
| ------------- | ------------------------------------------------- |
| 8.x           | 5.x                                               |
| 7.x           | 5.x                                               |
| 6.x           | 5.x                                               |
| 5.8.x         | 5.x                                               |
| 5.7.x         | 5.x                                               |
| 5.6.x         | 5.x                                               |
| 5.5 and below | <https://github.com/Xethron/migrations-generator> |

### Install

The recommended way to install this is through composer:

```bash
composer require --dev "kitloong/laravel-migrations-generator"
```

## Learn More

{% embed url="<https://github.com/kitloong/laravel-migrations-generator>" %}
