Laravel 创建指定表 migrate

时间:2019-12-03 20:02:38   收藏:0   阅读:54

解决方案:
打开创建表的那个 migration 文件,在创建表的方法执行之前加一个判断条件

if (!Schema::hasTable(‘password_resets‘)) {
    Schema::create(‘password_resets‘, function (Blueprint $table) {
        $table->string(‘email‘)->index();
        $table->string(‘token‘);
        $table->timestamp(‘created_at‘)->nullable();
    });
}

  

原文:https://www.cnblogs.com/mmykdbc/p/11978843.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!