Hi! I'm trying to run my database migration and I get this error
SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'id_jeciste' (SQL: create table militer (id int unsigned not null auto_increment primary key, id_jeciste bigint unsigned not null, id_annee bigint unsigned not null, level_instance int unsigned not null, instance int unsigned not null, poste varchar(255) not null, debut date null, fin date null, created_at timestamp null, updated_at timestamp null, id_jeciste bigint unsigned not null, id_annee bigint unsigned not null
) default character set utf8mb4 collate 'utf8mb4_unicode_ci')
Here is the code of the migration of the concerned table
class CreateJecMiliterTable extends Migration {
/**
* Run the migrations. *
* * @return void */
* public function up()
{
Schema::disableForeignKeyConstraints();
Schema::create('militer', function (Blueprint $table) {
$table->increments('id');
$table->unsignedBigInteger('id_jeciste');
$table->unsignedBigInteger('id_annee');
$table->unsignedInteger('level_instance');
$table->unsignedInteger('instance');
$table->string('poste');
$table->date('debut') -> nullable();
$table->date('fin') -> nullable();
$table->timestamps();
$table -> foreignId('id_jeciste')
-> references('id')->on('jecistes')
->onDelete('cascade')->onUpdate('cascade');
$table -> foreignId('id_annee')
-> references('id')->on('annees_pastorales')
->onDelete('cascade')->onUpdate('cascade');
});
}
/**
* Reverse the migrations. *
* * @return void */
public function down(){
Schema::table('militer', function (Blueprint $table) {
$table->dropForeign(['id_jeciste']);
$table->dropForeign(['id_annee']);
});
Schema::dropIfExists('militer');
}
}
I tried to do php artisan migrate:refresh but I have the same issue