创建migrate 文件
php artisan make:migration create_comments_table
编辑表字段
<?phpuse Illuminate\Database\Schem<strong>*本文来源gaodai#ma#com搞@代~码^网+</strong><strong>搞代gaodaima码</strong>a\Blueprint;use Illuminate\Database\Migrations\Migration;class CreateCommentTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('comment',function(Blueprint $table){ $table->engine = 'InnoDB'; $table->increments('id'); $table->integer('news_id'); $table->string('author_name'); $table->string('author_url'); $table->string('author_key'); $table->string('ip'); $table->string('message'); $table->string('mail'); $table->integer('create_time'); $table->integer('parent_id'); }); } /** * Reverse the migrations. * * @return void */ public function down() { // }}
创建表
php artisan migrate