-
Notifications
You must be signed in to change notification settings - Fork 3
[Refactpr][jjaeroong]: 회원탈퇴 시, provider_id를 null로 변경 #459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
DB 스키마(컬럼 NOT NULL 해제) 마이그레이션 없으면 런타임 장애 발생
엔티티에서
providerId를 nullable로 바꿨지만, 실제 DB 컬럼이 아직NOT NULL이면deleteUser()에서null로 세팅 후 flush 시 제약 위반이 납니다. 배포 전에 반드시 스키마 마이그레이션과 데이터 백필을 포함하세요.providerId의 NOT NULL 제거is_deleted = true) 레코드의providerId도NULL로 백필또한 복합 유니크(테이블 수준
uk_provider_provider_id:provider,providerId)와의 상호작용을 DB별로 확인 필요합니다. 다수 DB(MySQL, PostgreSQL)는 NULL을 유니크 비교에서 제외하지만, DB 방언에 따라 동작이 다를 수 있습니다. 운영 DB 방언을 확인하고 필요시 “활성 사용자만” 유니크가 적용되도록 부분(필터드) 인덱스/제약으로 보완을 검토하세요.예시(실 DB/네이밍 전략에 맞게 조정):
ALTER TABLE user MODIFY COLUMN provider_id VARCHAR(255) NULL;UPDATE user SET provider_id = NULL WHERE is_deleted = 1;ALTER TABLE "user" ALTER COLUMN "providerId" DROP NOT NULL;UPDATE "user" SET "providerId" = NULL WHERE is_deleted = true;다음 스크립트로 레포 내 마이그레이션 도입 여부와 관련 변경이 포함됐는지 빠르게 점검해 주세요(루트에서 실행).
🏁 Script executed:
Length of output: 81
🏁 Script executed:
Length of output: 23423
긴급: DB 마이그레이션 추가 필요 (providerId NULL 허용)
엔티티에서 providerId를 nullable로 변경했고 delete 흐름에서 this.providerId = null로 설정하지만, 레포에서 관련 스키마/데이터 마이그레이션(또는 Flyway/Liquibase 의존성)이 발견되지 않았습니다. 운영 DB가 아직 NOT NULL이면 flush 시 제약 위반으로 서비스 장애가 발생합니다.
조치 (필수)
참고 위치
🤖 Prompt for AI Agents