清除表时先忽略外键约束

DB::statement('SET FOREIGN_KEY_CHECKS=0;');
App\User::truncate();
DB::statement('SET FOREIGN_KEY_CHECKS=1;');

参见: http://stackoverflow.com/ques...


freedog
294 声望16 粉丝

啥都玩玩吧