这是我的迁移表
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUserTable extends Migration
{
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->integer('role_id')->unsigned();
$table->string('name');
$table->string('email',50)->unique();
$table->string('username');
$table->string('password');
$table->boolean('active');
$table->rememberToken();
$table->timestamps();
});
}
public function down()
{
Schema::dropIfExists('users');
}
}
Run Code Online (Sandbox Code Playgroud)
每当我尝试迁移时,都会发生以下错误
* [Illuminate \ Database \ QueryException] SQLSTATE [42S01]:基本表或视图已经存在:1050表'user'确实存在(SQL:创建表users(idint unsigned not null auto_increment主键,role_idint unsigned not null,namevarchar( 191)不为空,emailvarchar(50)不为空,usernamevarchar(191)不为空,pas
swordvarchar(191)不为空,activetinyint(1)不为空,remember_token
varchar(100)为空,created_at时间戳为null,updated_at时间戳为nu …