-
Notifications
You must be signed in to change notification settings - Fork 2
[배포] DataIntegrityViolationException 처리 #315
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| ALTER TABLE virtual_account_log | ||
| DROP COLUMN deposit_status; | ||
|
|
||
| ALTER TABLE virtual_account_log | ||
| ADD deposit_status VARCHAR(255) NULL; | ||
|
Comment on lines
+1
to
+5
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 현재 마이그레이션 스크립트는 데이터 손실을 방지하고 데이터 무결성을 지키기 위해, |
||
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.
전화번호로 기존 사용자를 찾는 로직에 버그가 있을 수 있습니다.
UserJpaEntity에는PhoneNumberUtil.formatPhoneNumber()를 통해 'U' 접두사가 붙은 전화번호가 저장됩니다. 하지만 현재 코드는 접두사 없는 원본 전화번호로 조회하고 있어, 항상 기존 사용자를 찾지 못하고 신규 사용자 생성을 시도하게 됩니다. 이로 인해 의도치 않게DataIntegrityViolationException이 발생하고 예외 처리 로직에 의존하게 될 수 있습니다.findByPhoneNumber호출 전에 전화번호를 포맷팅하여 이 문제를 해결하는 것이 좋습니다.