table('identification_parts_analyses'); if ($table->hasIndexByName('uniq_part_analysis')) { $table->removeIndexByName('uniq_part_analysis')->update(); } } public function down(): void { $table = $this->table('identification_parts_analyses'); if (!$table->hasIndexByName('uniq_part_analysis')) { $table->addIndex(['part_id', 'analysis_recordkey'], [ 'unique' => true, 'name' => 'uniq_part_analysis', ])->update(); } } }