jialeo/laravel-schema-extend

There is no license information available for the latest version (v1.1) of this package.

support MySQL 'table comment','int' data type length setting

v1.1 2020-02-10 07:07 UTC

This package is auto-updated.

Last update: 2024-11-11 15:27:00 UTC


README

forked from zedisdog/laravel-schema-extend

  • support MySQL 'table comment'.
  • 'int' data type length setting

使用前的准备

在 composer.json 文件中申明依赖:

  • support laravel 5.*
"Jialeo/laravel-schema-extend": "~0.5"

在配置文件 config/app.php 中替换“别名”

'aliases' => array(
    ...
    // 'Schema' => Illuminate\Support\Facades\Schema::class,
    'Schema'    => Jialeo\LaravelSchemaExtend\Schema::class,
),

使用方法

Schema::create('tests', function ($table) {
    $table->increments('id')->comment('列注释');
    $table->comment = '表注释';

    $table->integer('int')->default(1)->length(1);
    $table->bigInteger('big')->default(1)->length(1);
    $table->smallInteger('small')->default(1)->length(1);
    $table->tinyInteger('tiny')->default(1)->length(1);
    $table->mediumInteger('medium')->default(1)->length(1);
});