-
Notifications
You must be signed in to change notification settings - Fork 0
feat : 퀴즈 삭제 API 추가 #88
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
Merged
Changes from all commits
Commits
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
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
Oops, something went wrong.
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.
💡 Verification agent
🧩 Analysis chain
연관 엔티티(QuizOptions 등) 삭제 보장 필요 — FK 제약 위반/고아 레코드 위험
현재 Quiz만 삭제합니다. Quiz ↔ QuizOptions, DailyMissionMaster ↔ Quiz 등 연관관계에서
엔티티 매핑 또는 DB 제약을 점검/보완해주세요. 없다면 다음과 같이 매핑을 권장합니다(참고용, 엔티티 파일에서 적용).
또는 서비스 계층에서 명시적으로 자식부터 삭제하는 전략을 택할 수 있습니다.
아래 스크립트로 매핑 상태를 빠르게 점검해볼 수 있습니다.
🏁 Script executed:
Length of output: 979
추가 검증을 위해 오류 발생 시에도 계속 진행하도록 스크립트를 수정했습니다. 아래 스크립트를 실행한 후 결과를 공유해주세요.
🏁 Script executed:
Length of output: 1463
추가로
DailyMissionMaster ↔ Quiz매핑 상태도 확인할 수 있도록 아래 스크립트를 실행해주세요.🏁 Script executed:
Length of output: 5081
연관 엔티티 삭제 매핑 추가 필요
현재
deleteQuiz메서드는Quiz엔티티만 삭제하며, 다음과 같은 위험이 있습니다.QuizOptions(Quiz ↔ QuizOptions) 연관관계에cascade또는orphanRemoval설정이 없어, 부모 삭제 시 FK 제약 위반 또는 자식 레코드 고아 상태 발생quiz_options테이블의 FK에ON DELETE CASCADE설정이 없음DailyMissionMaster ↔ Quiz관계가 실제로 존재한다면) 해당 매핑도 누락되어 동일한 위험점검 결과
@OneToMany매핑 정의 없음@ManyToOne만 있고 cascade/orphanRemoval 설정 없음FOREIGN KEY … quiz_options/ON DELETE CASCADE정의 없음조치 방안
src/main/java/com/example/cp_main_be/domain/mission/quiz/domain/Quiz.java에 자식 엔티티 매핑 추가 (예시)ON DELETE CASCADE설정 추가🤖 Prompt for AI Agents