我正在使用 laravel,我正在尝试进行另一次迁移,但该表已经存在,因此它会引发以下错误:
[PDOException]
SQLSTATE[42S01]: Base table or view already
exists: 1050 Table 'users' already exists
我已将此行添加到迁移文件中:
$table->softDeletes();
这是完整的文件:
<?php
use Illuminate\Database\Migrations\Migration;
class ConfideSetupUsersTable extends Migration
{
/**
* Run the migrations.
*/
public function up()
{
// Creates the users table
Schema::create('users', function ($table) {
$table->increments('id');
$table->string('firstname');
$table->string('lastname');
$table->string('username')->unique();
$table->string('email')->unique();
$table->string('password');
$table->string('confirmation_code');
$table->string('remember_token')->nullable();
$table->softDeletes();
$table->boolean('confirmed')->default(false);
$table->timestamps();
});
// Creates password reminders table
Schema::create('password_reminders', function ($table) {
$table->string('email');
$table->string('token');
$table->timestamp('created_at');
});
}
/**
* Reverse the migrations.
*/
public function down()
{
Schema::drop('password_reminders');
Schema::drop('users');
}
}
任何想法我做错了什么?