Giter Club home page Giter Club logo

laravel-migration-generator's Introduction

laravel-migration-generator [5.x / 6.x / 7.x]

Build Status Latest Stable Version Test Coverage Maintainability License

This Migration-Generator generates Migrations in correct order, when referential integrity is used. So on remigrating them at example on a dev-system, local-system or others its possible to migrate the schema without constraint violations.

Version Compatibility

Laravel/Lumen PHP-Version Migration-Generator Life Support
5.x 7.2 up to 7.4 1.0.10 EOL
6.x 7.2 up to 7.4 1.0.10 EOL
7.x 7.2 up to 8.0 2.0.0 Yes

Requirements

  • PHP 7.2 or higher (php 8 is also supported)
    • Pdo_mysql extension
  • MySQL 5.7 or higher

Installation

You can install this package over composer via

composer require n3xt0r/laravel-migration-generator

You`ll not need to add any ServiceProviders to your Configuration on Laravel, this package will register itself on your project.

When you are using Lumen, make sure you have added following line to your app.php:

$app->register(\N3XT0R\MigrationGenerator\Providers\MigrationGeneratorServiceProvider::class);

Executing the Migrator from Artisan

This Migrator can be executed over the command line by using following command:

php artisan migrate:regenerate

It will dump all your tables to the database/migrations folder in correct order. So when you are using referential integrity it will write all migrations so that they could be re-migrated without changing manually the order of the migration-files.

Custom Export

Are you unhappy with the exported migrations? When you should need some customizations on it, it would be possible to customize the export by extending the export-classes over the DI-Container.

There is a Configuration file called "migration-generator", that you could publish and customize. Every Export-Function like "exporting fields" or "exporting indexes" or else has a Definition- and a Mapping-Class.

Definition-Classes

Definition-Classes are classes that define the internal runtime export-format. They are used to generate the Schema-Results to a universal format, so that you or anyone else could extend it.

Mapping-Classes

Mapping Classes are classes that converts internal universal format to executable php-code inside the migration-classes.

laravel-migration-generator's People

Contributors

n3xt0r avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.