Giter VIP home page Giter VIP logo

laravel5_migrated's Introduction

laravel5_migrated

Creates individual migration files from a MYSQL DB

基于laravel5.1把mysql数据库表信息转换成laravel框架迁移文件。方便快速开发。

本脚本是从laravel5-migrate-mysql而来,并修复了如下问题:

  • 修复enum字段类型,无法识别问题。
  • 增加复合主键功能转换。
  • 增加索引和复合索引转换。
  • 增加字段注释文字转换。

###安装

  1. Copy Makesqltomigration.php 文件到 app\Console\Commands
  2. 增加 'App\Console\Commands\MakesqltoMigration' 到 app\Console\Kernel.php的$commands 数组里。
class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        'App\Console\Commands\MakesqltoMigration',
    ];

###如何使用?

** 转换整个库 **

php artisan make:sqltomigrations dbName

** 转换整个库,包括字段注释 **

php artisan make:sqltomigrations dbName -C

** 只转换指定的表 **

php artisan make:sqltomigrations dbName --only=table1,table2 -C

** 转换整个库,忽略指定的表 **

php artisan make:sqltomigrations dbName --ignore=table1,table2 -C

** 执行转换好的迁移 **

```php artisan migrate --path=database/migrations/`date +%Y-%m-%d````

###BUG反馈

email: [email protected]

laravel5_migrated's People

Contributors

hzhihu avatar

Stargazers

 avatar

Watchers

 avatar  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.