From cf7e7cc6f5b8667c5e0d11eac41ecb6c45666bc4 Mon Sep 17 00:00:00 2001 From: happybell80 Date: Wed, 10 Sep 2025 00:31:19 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20Gmail=20=ED=86=A0=ED=81=B0=20=EB=AC=B8?= =?UTF-8?q?=EC=84=9C=20JSONB=20=EC=A0=84=EC=9A=A9=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 임시 DB 동기화 방안 제거 - JSONB 전용 전환 방향으로 통일 - 교훈 부분 간소화 (52줄) --- ...ppybell80_gmail_refresh_token_불일치.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/troubleshooting/250909_happybell80_gmail_refresh_token_불일치.md b/troubleshooting/250909_happybell80_gmail_refresh_token_불일치.md index 5d8ebe1..01a245d 100644 --- a/troubleshooting/250909_happybell80_gmail_refresh_token_불일치.md +++ b/troubleshooting/250909_happybell80_gmail_refresh_token_불일치.md @@ -35,18 +35,18 @@ HanYong: token_data 비어있음 (8/30 이후) ## 해결 방안 ```sql --- 1. 긴급: DB 동기화 (무효 토큰 문제 즉시 해결) -UPDATE gmail_tokens -SET refresh_token = token_data->>'refresh_token', - access_token = token_data->>'access_token' -WHERE token_data IS NOT NULL; - --- 2. 근본: skill-email 코드 JSONB 전환 +-- skill-email 코드 JSONB 전용으로 수정 -- 63번: token_data->>'refresh_token' as refresh_token -- 166번: token_data = jsonb_set(...) 사용 + +-- 개별 컬럼 삭제 (코드 수정 후) +ALTER TABLE gmail_tokens +DROP COLUMN access_token, +DROP COLUMN refresh_token, +DROP COLUMN token_type, +DROP COLUMN expires_at; ``` ## 교훈 -- 레거시 컬럼과 JSONB 병행 사용 시 동기화 필수 -- 코드 마이그레이션 시 모든 서비스 일괄 수정 -- 토큰 갱신 실패 시 저장 위치 불일치 확인 \ No newline at end of file +- JSONB만 사용하여 데이터 일관성 확보 +- 중복 저장 구조는 반드시 제거 \ No newline at end of file