From 2afcc4448bcbdd9590edbee77cdee9aa7b3a8112 Mon Sep 17 00:00:00 2001 From: Hyungi Ahn Date: Mon, 23 Mar 2026 12:44:57 +0900 Subject: [PATCH] =?UTF-8?q?fix(tkuser):=20=EB=A7=88=EC=9D=B4=EA=B7=B8?= =?UTF-8?q?=EB=A0=88=EC=9D=B4=EC=85=98=20SQL=20=EC=88=9C=EC=84=9C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20=E2=80=94=20ADD=20INDEX=20=ED=9B=84=20DROP?= =?UTF-8?q?=20INDEX?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit FK가 기존 unique_user_type_year 인덱스를 참조하므로 새 인덱스를 먼저 추가한 뒤 기존 것을 삭제해야 함 Co-Authored-By: Claude Opus 4.6 (1M context) --- .../migrations/20260323_sprint001_vacation_overhaul.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/user-management/migrations/20260323_sprint001_vacation_overhaul.sql b/user-management/migrations/20260323_sprint001_vacation_overhaul.sql index eeddb82..90b28b5 100644 --- a/user-management/migrations/20260323_sprint001_vacation_overhaul.sql +++ b/user-management/migrations/20260323_sprint001_vacation_overhaul.sql @@ -61,13 +61,13 @@ ALTER TABLE sp_vacation_balances ADD COLUMN IF NOT EXISTS expires_at DATE NULL COMMENT '만료일 (NULL=해당연도말)'; -- UNIQUE KEY 변경: balance_type을 포함하여 같은 user/type/year에 AUTO + LONG_SERVICE 공존 허용 --- 기존 UNIQUE KEY 삭제 후 재생성 -ALTER TABLE sp_vacation_balances - DROP INDEX IF EXISTS unique_user_type_year; - +-- 새 인덱스를 먼저 추가해야 FK(user_id)가 새 인덱스를 참조 가능 ALTER TABLE sp_vacation_balances ADD UNIQUE KEY unique_user_type_year_btype (user_id, vacation_type_id, year, balance_type); +ALTER TABLE sp_vacation_balances + DROP INDEX IF EXISTS unique_user_type_year; + -- ============================================================ -- 5. sso_users에 장기근속 제외 플래그 -- ============================================================