Skip to content

[Fix] 익명 번호 결정 방식 MAX 기반으로 변경 및 V5 마이그레이션#147

Merged
kkw610 merged 1 commit into
developfrom
fix/#146
May 31, 2026
Merged

[Fix] 익명 번호 결정 방식 MAX 기반으로 변경 및 V5 마이그레이션#147
kkw610 merged 1 commit into
developfrom
fix/#146

Conversation

@kkw610

@kkw610 kkw610 commented May 31, 2026

Copy link
Copy Markdown
Collaborator

#️⃣연관된 이슈

#146

📝작업 내용

QuestionAnonymousIdentityRepository.java

  • findMaxAnonymousNoByQuestionAndRole() 추가
  • 이미 부여된 번호 중 MAX를 조회하고, 아무도 없으면 COALESCE로 0을 반환
  • COUNT와 달리 이미 저장 완료된 값 기준으로 동작하기 때문에 중복 가능성이 낮아짐

QuestionService.java

  • assignAnonymousIdentity() 내부에서 countByQuestionAndUser_Role() 대신 findMaxAnonymousNoByQuestionAndRole() 사용하도록 변경

V5__add_unique_constraint_question_anonymous_identity.sql

  • (question_id, user_id) 조합에 유니크 제약 추가
  • 혹시라도 동시 요청이 겹쳐 중복 저장을 시도하면 DB 레벨에서 차단

Closes #146

@kkw610 kkw610 self-assigned this May 31, 2026
@kkw610 kkw610 linked an issue May 31, 2026 that may be closed by this pull request
3 tasks
@vercel

vercel Bot commented May 31, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
piro-in Ready Ready Preview, Comment May 31, 2026 12:20pm
piro-in-765d Ready Ready Preview, Comment May 31, 2026 12:20pm

@kkw610 kkw610 merged commit f7f4191 into develop May 31, 2026
4 checks passed
@kkw610 kkw610 deleted the fix/#146 branch May 31, 2026 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Fix] 동시 댓글 작성 시 익명 번호 중복 부여 문제 수정

1 participant