laravel做数据迁移的时候进行表的注释

只需要加以据alter语句即可:

  public function up()
    {
        $tableName = 'xxx';
        Schema::create($tableName, function (Blueprint $table) {
            $table->increments('id');
            $table->timestamps();
        });

       \DB::statement("ALTER TABLE $tableName comment '这是注释'");
    }

  

posted @ 2021-03-26 09:53  明明一颗大白菜  阅读(376)  评论(0编辑  收藏  举报
<-- -->