Skip to content

Commit a53637c

Browse files
authored
Merge pull request #115 from team-ppointer/hotfix/soft-delete
[hotfix] softdelete hibernate 6로 교체
2 parents 0d78759 + 3cd3d02 commit a53637c

File tree

5 files changed

+30
-25
lines changed

5 files changed

+30
-25
lines changed

src/main/java/com/moplus/moplus_server/domain/problemset/repository/ProblemSetSearchRepositoryCustom.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ public List<ProblemSetSearchGetResponse> search(String problemSetTitle, String p
2525
.from(problemSet)
2626
.leftJoin(problem).on(problem.id.in(problemSet.problemIds)) // 문제 세트 내 포함된 문항과 조인
2727
.where(
28-
problemSet.isDeleted.isFalse(),
2928
containsProblemSetTitle(problemSetTitle),
3029
containsProblemTitle(problemTitle)
3130
)
@@ -51,7 +50,6 @@ public List<ProblemSetSearchGetResponse> confirmSearch(String problemSetTitle, S
5150
.from(problemSet)
5251
.leftJoin(problem).on(problem.id.in(problemSet.problemIds)) // 문제 세트 내 포함된 문항과 조인
5352
.where(
54-
problemSet.isDeleted.isFalse(),
5553
problemSet.confirmStatus.eq(CONFIRMED),
5654
containsProblemSetTitle(problemSetTitle),
5755
containsProblemTitle(problemTitle)

src/test/resources/insert-problem-set.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ DELETE
44
FROM problem_set;
55

66
-- 문제 세트 추가
7-
INSERT INTO problem_set (problem_set_id, title, is_deleted, confirm_status)
7+
INSERT INTO problem_set (problem_set_id, title, deleted, confirm_status)
88
VALUES (1, '2025년 5월 고2 모의고사 문제 세트', false, 'NOT_CONFIRMED');
9-
INSERT INTO problem_set (problem_set_id, title, is_deleted, confirm_status)
9+
INSERT INTO problem_set (problem_set_id, title, deleted, confirm_status)
1010
VALUES (2, '2025년 5월 고3 모의고사 문제 세트', false, 'CONFIRMED');
1111

1212
-- 문제 세트에 포함된 문제 추가

src/test/resources/insert-problem-set2.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ DELETE FROM problem_set_problems;
22
DELETE FROM problem_set;
33

44
-- 문제 세트 추가
5-
INSERT INTO problem_set (problem_set_id, title, is_deleted, confirm_status)
5+
INSERT INTO problem_set (problem_set_id, title, deleted, confirm_status)
66
VALUES (1, '2025년 5월 고2 모의고사 문제 세트', false, 'CONFIRMED');
77

88
-- 문제 세트에 포함된 문제 추가

src/test/resources/insert-problem.sql

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@ INSERT INTO problem (problem_id,
2121
answer_type,
2222
is_confirmed,
2323
recommended_minute,
24-
recommended_second)
24+
recommended_second,
25+
deleted)
2526
VALUES (1, '1224052001', 1, 1, 'GICHUL_PROBLEM', '제목1', '1', 5, '기존 문제 설명 1',
2627
'mainProblem.png1', 'mainAnalysis.png1', 'readingTip.png1', 'seniorTip.png1',
27-
'prescription.png1', 'MULTIPLE_CHOICE', false, 30, 45),
28+
'prescription.png1', 'MULTIPLE_CHOICE', false, 30, 45, false),
2829
(2, '1224052002', 1, 1, 'GICHUL_PROBLEM', '제목2', '1', 5, '기존 문제 설명 2',
2930
'mainProblem.png2', 'mainAnalysis.png2', 'readingTip.png2', 'seniorTip.png2',
30-
'prescription.png2', 'MULTIPLE_CHOICE', false, 25, 30);
31+
'prescription.png2', 'MULTIPLE_CHOICE', false, 25, 30, false);
3132

3233
-- 자식 문제 테이블 생성
3334
CREATE TABLE IF NOT EXISTS child_problem (
@@ -36,7 +37,8 @@ CREATE TABLE IF NOT EXISTS child_problem (
3637
image_url VARCHAR(255),
3738
answer_type VARCHAR(50),
3839
answer VARCHAR(255),
39-
sequence INT
40+
sequence INT,
41+
deleted BOOLEAN
4042
);
4143

4244
-- 자식 문제 데이터 삽입
@@ -45,9 +47,10 @@ INSERT INTO child_problem (child_problem_id,
4547
image_url,
4648
answer_type,
4749
answer,
48-
sequence)
49-
VALUES (1, 1, 'child1.png', 'MULTIPLE_CHOICE', '1', 0),
50-
(2, 1, 'child2.png', 'SHORT_ANSWER', '정답2', 1);
50+
sequence,
51+
deleted)
52+
VALUES (1, 1, 'child1.png', 'MULTIPLE_CHOICE', '1', 0, false),
53+
(2, 1, 'child2.png', 'SHORT_ANSWER', '정답2', 1, false);
5154

5255
-- 문제-컨셉 태그 연결 테이블 생성
5356
CREATE TABLE IF NOT EXISTS problem_concept (

src/test/resources/insert-problem2.sql

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,22 @@ INSERT INTO problem (problem_id,
2626
answer_type,
2727
is_confirmed,
2828
recommended_minute,
29-
recommended_second)
29+
recommended_second,
30+
deleted)
3031
VALUES (1, '24052001001', 1, 1, 'GICHUL_PROBLEM', '제목1', '1', 5, '기존 문제 설명',
3132
'mainProblem.png', 'mainAnalysis.png', 'mainHandwriting1.png', 'readingTip.png', 'seniorTip.png',
3233
'prescription1.png, prescription2.png', 'MULTIPLE_CHOICE', false,
33-
30, 0),
34+
30, 0, false),
3435

3536
(2, '24052001002', 1, 2, 'GICHUL_PROBLEM', '제목2', '2', 4, '문제 2 설명',
3637
'mainProblem2.png', 'mainAnalysis2.png', 'mainHandwriting2.png', 'readingTip2.png', 'seniorTip2.png',
3738
'prescription3.png, prescription4.png', 'MULTIPLE_CHOICE', false,
38-
20, 30),
39+
20, 30, false),
3940

4041
(3, '24052001003', 1, 3, 'GICHUL_PROBLEM', '제목3', '3', 3, '문제 3 설명',
4142
'mainProblem3.png', 'mainAnalysis3.png', 'mainHandwriting3.png', 'readingTip3.png', 'seniorTip3.png',
4243
'prescription5.png, prescription6.png', 'SHORT_ANSWER', true,
43-
15, 45);
44+
15, 45, false);
4445

4546
-- 자식 문제 데이터 삽입
4647
INSERT INTO child_problem (child_problem_id,
@@ -49,11 +50,12 @@ INSERT INTO child_problem (child_problem_id,
4950
answer_type,
5051
answer,
5152
sequence,
52-
prescription_image_urls)
53-
VALUES (1, 1, 'child1.png', 'MULTIPLE_CHOICE', '1', 0, 'child1_prescription1.png, child1_prescription2.png'),
54-
(2, 1, 'child2.png', 'SHORT_ANSWER', '정답2', 1, 'child2_prescription1.png, child2_prescription2.png'),
55-
(3, 2, 'child3.png', 'MULTIPLE_CHOICE', '2', 0, 'child3_prescription1.png, child3_prescription2.png'),
56-
(4, 3, 'child4.png', 'SHORT_ANSWER', '3', 0, 'child4_prescription1.png, child4_prescription2.png');
53+
prescription_image_urls,
54+
deleted)
55+
VALUES (1, 1, 'child1.png', 'MULTIPLE_CHOICE', '1', 0, 'child1_prescription1.png, child1_prescription2.png', false),
56+
(2, 1, 'child2.png', 'SHORT_ANSWER', '정답2', 1, 'child2_prescription1.png, child2_prescription2.png', false),
57+
(3, 2, 'child3.png', 'MULTIPLE_CHOICE', '2', 0, 'child3_prescription1.png, child3_prescription2.png', false),
58+
(4, 3, 'child4.png', 'SHORT_ANSWER', '3', 0, 'child4_prescription1.png, child4_prescription2.png', false);
5759

5860
-- 문제-컨셉 태그 연결
5961
INSERT INTO problem_concept (problem_id, concept_tag_id)
@@ -94,20 +96,22 @@ INSERT INTO problem (problem_id,
9496
answer_type,
9597
is_confirmed,
9698
recommended_minute,
97-
recommended_second)
99+
recommended_second,
100+
deleted)
98101
VALUES (4, '24052001004', 1, 4, 'GICHUL_PROBLEM', '제목4', '4', 1, '유효한 문제로 수정',
99102
'mainProblem4.png', 'mainAnalysis4.png', 'mainHandwriting4.png', 'readingTip4.png', 'seniorTip4.png',
100103
'prescription7.png, prescription8.png', 'MULTIPLE_CHOICE', false,
101-
20, 0);
104+
20, 0, false);
102105

103106
-- problem 4에 대한 자식 문제 추가
104107
INSERT INTO child_problem (child_problem_id,
105108
problem_id,
106109
image_url,
107110
answer_type,
108111
answer,
109-
sequence)
110-
VALUES (5, 4, 'child5.png', 'MULTIPLE_CHOICE', '4', 0);
112+
sequence,
113+
deleted)
114+
VALUES (5, 4, 'child5.png', 'MULTIPLE_CHOICE', '4', 0, false);
111115

112116
-- problem 4와 자식 문제에 대한 컨셉 태그 추가
113117
INSERT INTO problem_concept (problem_id, concept_tag_id)

0 commit comments

Comments
 (0)