From 78656bddf74c3540194d668599f3e22f054f1be9 Mon Sep 17 00:00:00 2001 From: kkw610 Date: Tue, 2 Jun 2026 15:09:56 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20V6=20=EB=A7=88=EC=9D=B4=EA=B7=B8?= =?UTF-8?q?=EB=A0=88=EC=9D=B4=EC=85=98=20-=20question=5Flike,=20understand?= =?UTF-8?q?ing=5Fresponse=20=EC=9C=A0=EB=8B=88=ED=81=AC=20=EC=A0=9C?= =?UTF-8?q?=EC=95=BD=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nique_constraints_like_and_understanding_response.sql | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 backend/src/main/resources/db/migration/V6__add_unique_constraints_like_and_understanding_response.sql diff --git a/backend/src/main/resources/db/migration/V6__add_unique_constraints_like_and_understanding_response.sql b/backend/src/main/resources/db/migration/V6__add_unique_constraints_like_and_understanding_response.sql new file mode 100644 index 0000000..6d711d8 --- /dev/null +++ b/backend/src/main/resources/db/migration/V6__add_unique_constraints_like_and_understanding_response.sql @@ -0,0 +1,9 @@ +-- QuestionLike: 같은 유저가 같은 질문에 좋아요를 중복으로 누르는 것을 DB 레벨에서 차단 +ALTER TABLE question_like + ADD CONSTRAINT uq_question_like_question_user + UNIQUE (question_id, user_id); + +-- UnderstandingResponse: 같은 유저가 같은 이해도 체크에 중복 응답하는 것을 DB 레벨에서 차단 +ALTER TABLE understanding_response + ADD CONSTRAINT uq_understanding_response_check_user + UNIQUE (check_id, user_id); \ No newline at end of file