PHPackages                             filippo-toso/migrations-generator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. filippo-toso/migrations-generator

ActiveLibrary[Database &amp; ORM](/categories/database)

filippo-toso/migrations-generator
=================================

A Laravel Artisan command to automatically generate migrations from database tables

v1.6.0(6y ago)1201MITPHPPHP ^7.1.3

Since Apr 15Pushed 6y agoCompare

[ Source](https://github.com/filippotoso/migrations-generator)[ Packagist](https://packagist.org/packages/filippo-toso/migrations-generator)[ RSS](/packages/filippo-toso-migrations-generator/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (12)Used By (0)

Migrations Generator
====================

[](#migrations-generator)

A Laravel Artisan command to automatically generate migrations from database tables.

Requirements
------------

[](#requirements)

- PHP 5.6+
- Laravel 5.4+
- Doctrine DBAL +2.8

Installing
----------

[](#installing)

Use Composer to install it:

```
composer require filippo-toso/migrations-generator

```

How does it work?
-----------------

[](#how-does-it-work)

This generator is very simple. It builds the migrations from the database and saves them in the database folder.

By default the generator doesn't create the models of Laravel's tables like jobs, cache, and so on. You can modify this behavior publishing the package resources and editing the config/migrations-generator.php file.

Configuration
-------------

[](#configuration)

You can publish the configuration file with the following command:

```
php artisan vendor:publish --tag=config --provider="FilippoToso\MigrationsGenerator\ServiceProvider"

```

The config/migration-generator.php file allows you to:

- define which tables exclude form the generation (ie. cache, jobs, migrations, ...)

Just open the file and read the comments :)

Options
-------

[](#options)

The predefined use from command line is:

```
php artisan generate:migrations

```

This command generates the migrations with the current time (plus one second for each table).

If there are existing migrations they will not be overwritten.

You can modify the default behavior using the following parameters:

```
php artisan generate:migrations --overwrite

```

With the overwrite option the generator will remove the previously generated migrations with the same class name.

```
php artisan generate:migrations --connection=sqlite

```

You can specify a different connection if you need to.

Workflow
--------

[](#workflow)

To gain the maximum benefits from this package you should follow this workflow:

- design the database (i.e. with MySQL Workbench)
- execute the SQL CREATE statement in your MySQL
- configure the generator
- run the generator
- customize the migrations in the database folder

You must follow Laravel's guidelines about tables and columns names and also include in your SQL statements all the required foreign keys and indexes.

Known Issues
------------

[](#known-issues)

If you have two (or more) tables inter-related, you will need to manually move the foreign key definitions in a separate migrations that will run after all the tables has been created

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~17 days

Recently: every ~39 days

Total

11

Last Release

2413d ago

Major Versions

v0.0.1 → v1.0.02019-04-15

### Community

Maintainers

![](https://www.gravatar.com/avatar/55d89f2d44fb12225de2119994028ee69e36770bcf33c2b1ddf0d6672d28151b?d=identicon)[filippo.toso](/maintainers/filippo.toso)

---

Top Contributors

[![filippotoso](https://avatars.githubusercontent.com/u/26958813?v=4)](https://github.com/filippotoso "filippotoso (11 commits)")

### Embed Badge

![Health badge](/badges/filippo-toso-migrations-generator/health.svg)

```
[![Health](https://phpackages.com/badges/filippo-toso-migrations-generator/health.svg)](https://phpackages.com/packages/filippo-toso-migrations-generator)
```

###  Alternatives

[laravel-doctrine/orm

An integration library for Laravel and Doctrine ORM

8425.3M87](/packages/laravel-doctrine-orm)[scienta/doctrine-json-functions

A set of extensions to Doctrine that add support for json query functions.

58523.9M36](/packages/scienta-doctrine-json-functions)[sonata-project/entity-audit-bundle

Audit for Doctrine Entities

644989.8k1](/packages/sonata-project-entity-audit-bundle)[highsolutions/eloquent-sequence

A Laravel package for easy creation and management sequence support for Eloquent models with elastic configuration.

121130.3k](/packages/highsolutions-eloquent-sequence)[dragon-code/migrate-db

Easy data transfer from one database to another

15717.4k](/packages/dragon-code-migrate-db)[worksome/foggy

Foggy is a tool for making database dumps with some data removed/changed.

26571.7k1](/packages/worksome-foggy)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
