string("openid",50)->nullable()->change(); }); DB::statement("alter table `ufutx_partners` drop index `openid_unique`"); DB::statement("ALTER TABLE ufutx_partners ADD INDEX openid (openid);"); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('partners', function (Blueprint $table) { $table->string('openid',50)->nullable(false)->change(); // 这里需要确保没有null值在该列中 }); } };