<?php
 use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateBook extends Migration { public function up() { Schema::create('book', function (Blueprint $table) { $table->increments('id'); $table->timestamps(); $table->integer('memberUserId')->nullable()->comment('用户ID'); $table->string('title', 50)->nullable()->comment('名称'); $table->index(['memberUserId']); }); } public function down() { } } 