<?php
 use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; use ModStart\Core\Dao\ModelManageUtil; class ModifyMemberVip20210112 extends Migration { public function up() { if (!ModelManageUtil::hasTableColumn('member_vip_set', 'quotaQuestionViewDaily')) { Schema::table('member_vip_set', function (Blueprint $table) { $table->string('quotaQuestionViewDaily', 100)->nullable()->comment(''); }); } if (!ModelManageUtil::hasTable('member_vip_quota_question_view')) { Schema::create('member_vip_quota_question_view', function (Blueprint $table) { $table->increments('id'); $table->timestamps(); $table->integer('memberUserId')->nullable()->comment(''); $table->integer('questionId')->nullable()->comment('名称'); $table->date('day')->nullable()->comment(''); $table->unique(['memberUserId', 'day', 'questionId'], 'daily_unique'); $table->index(['memberUserId', 'questionId']); }); } } public function down() { } } 