<?php
 use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreateEventOrder extends Migration { public function up() { Schema::create('event_order', function (Blueprint $table) { $table->increments('id'); $table->timestamps(); $table->string('sn', 30)->nullable()->comment('订单号'); $table->integer('memberUserId')->comment('用户ID')->nullable(); $table->tinyInteger('status')->comment('正在报名')->nullable(); $table->decimal('totalFee', 20, 2)->nullable()->comment('总价格'); $table->decimal('payFee', 20, 2)->nullable()->comment('支付价格'); $table->timestamp('payTime')->nullable()->comment('支付时间'); $table->text('applyInfo')->comment('报名需要填写的字段')->nullable(); $table->integer('eventId')->comment('活动ID')->nullable(); $table->unique(['sn']); $table->index(['memberUserId']); $table->index(['eventId', 'status']); }); } public function down() { } } 