【发布时间】:2021-03-19 17:25:48
【问题描述】:
这里是迁移代码:
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->id();
$table->string('first_name');
$table->string('last_name');
$table->text('bio');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->string('profile_picture');
$table->rememberToken();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users');
}
}
【问题讨论】:
-
你是在已经有数据的表上运行这个吗?错误很简单。
-
迁移与该错误无关,您必须有一些迁移或播种器更改该表上的数据
-
我猜你输入了两次电子邮件,并且电子邮件是唯一的。
标签: php laravel laravel-artisan