Laravel 5.5 Error Base table or view already exists: 1050 Table 'users' already exists

前端 未结 15 1297
温柔的废话
温柔的废话 2020-11-30 10:22

Specifications:

  • Laravel Version: 5.5.3
  • PHP Version: 7.1
  • Database Driver & Version: MariaDB 10.1.26

15条回答
  •  醉梦人生
    2020-11-30 11:16

    You can skip migrate the table if table exist in database by add this code:

    public function up()
    {
        if(Schema::hasTable('users')) return;       //add this line to your database file
    
        Schema::create('users', function (Blueprint $table) {
            $table->increments('id');
            $table->timestamps();
    
        });
    }
    

提交回复
热议问题