fix(API): fix_unique_key 마이그레이션에 테이블 존재 체크 추가
- 테이블 미존재 시 스킵하여 순서 무관하게 안전 실행 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,11 @@
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
// 테이블이 아직 없으면 스킵 (후속 마이그레이션에서 생성됨)
|
||||
if (! Schema::hasTable('sales_scenario_checklists')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 기존 유니크 키가 존재하면 삭제
|
||||
$indexes = DB::select("SHOW INDEX FROM sales_scenario_checklists WHERE Key_name = 'sales_scenario_unique'");
|
||||
if (count($indexes) > 0) {
|
||||
|
||||
Reference in New Issue
Block a user