Skip to content

[FIX]: 배치도 재생성 시 Unique 제약 조건 오류 해결#139

Merged
sonjunkyu merged 1 commit intodevelopfrom
fix/table-layout
Feb 14, 2026
Merged

[FIX]: 배치도 재생성 시 Unique 제약 조건 오류 해결#139
sonjunkyu merged 1 commit intodevelopfrom
fix/table-layout

Conversation

@sonjunkyu
Copy link
Contributor

💡 작업 개요

이전에 한 가게에 isActive = true인 배치도가 1개 이상 존재하는 것을 방지하기 위해 Unique 제약 조건을 추가했습니다.
기존 배치도가 삭제되면 isActive = false, store_active_key = null로 변경되야 합니다.

배치도 삭제 - 재생성 로직이 하나의 트랜잭션에서 동작하여 JPA 영속성 컨텍스트에서는 아직 반영되지 않아
store_active_key는 null로 값이 바뀌지 않아 Unique 제약 위반을 하게 됩니다.

그래서 tableLayoutRepository.delete() 이후 flush()를 추가하여 DB에 즉시 반영되도록 코드를 수정했습니다.

✅ 작업 내용

  • 기능 개발
  • 버그 수정
  • 리팩토링
  • 주석/포맷 정리
  • 기타 설정

🧪 테스트 내용

  • Swagger 테스트 시 정상 작동, 기존 배치도는 isActive = false, store_active_key = null로 변경된 것을 확인.

📝 기타 참고 사항

  • 협업 관련 이슈, 주의 사항 등

@coderabbitai
Copy link

coderabbitai bot commented Feb 12, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/table-layout

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonjunkyu sonjunkyu merged commit e7c5297 into develop Feb 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants