Я пытаюсь выполнить эту миграцию, но она выдаёт мне эту ошибку
enter code here
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateUsersTable extends Migration
{
public function up()
{
//CREANDO UN MODELO PARA LOS ROLES DEL USUARIO
Schema::create('roles', function (Blueprint $table) {
$table->Increments('id');
$table->string('name')->comment('Nombre del rol del usuario');
$table->text('description');
$table->timestamps();
});
Schema::create('users', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedInteger('role_id')->default(\App\Role::STUDENT);
$table->foreign('role_id')->references('id')-> on('roles');
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->string('picture')->nullable();
//cashier columns
$table->string('stripe_id')->nullable();
$table->string('card_brand')->nullable();
$table->string('card_last_four', 4)->nullable();
$table->timestamp('trial_ends_at')->nullable();
$table->rememberToken();
$table->timestamps();
});
Schema::create('subscriptions',function (Blueprint $table) {
$table->increments('id');
$table->unsignedBigInteger('user_id');
$table->foreign('user_id')->references('id')->on('users');
$table->string('name');
$table->string('stripe_status');
$table->string('stripe_plan');
$table->integer('quantity');
$table->timestamp('trial_ends_at')->nullable();
$table->timestamp('ends_at')->nullable();
$table->timestamps();
});
Schema::create('user_social_accounts', function (Blueprint $table) {
$table->increments('id');
$table->unsignedBigInteger('user_id');
$table->foreign('user_id')->references('id')-> on('users');
$table->string('provider');
$table->string('provider_uid');
});
}
public function down()
{
Schema::dropIfExists('users');
Schema::dropIfExists('roles');
Schema::dropIfExists('subscriptions');
Schema::dropIfExists('user_social_accounts');
}
}
и выдаёт эту ошибку
Столбец уже существует: 1060 Повторяющееся имя столбца 'stripe_id' (SQL:изменить таблицу users
добавить stripe_id
varchar (255) null, добавить card_brand
varchar (255) null, добавить card_last_four
varchar (4) null, добавить trial_ends_at
timestamp null)
Trace Exception trace:
1 PDOException: :( "SQLSTATE [42S21]: Столбец уже существует: 1060 Повторяющееся имя столбца 'stripe_id'") C: \ laragon \ www \ learning \ vendor \ laravel \ framework \ src \ Illuminate \ \База данных \ Connection.php: 459
2 PDOStatement :: execute () C: \ laragon \ www \ learning \ vendor \ laravel \ framework \ src \ Illuminate \ Database \ Connection.php: 459