Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ public class DailyReportController {

| 응답의 emotion | 해당 감정 |
| :--- | :--- |
| `JOY` | 기쁨 |
| `ACHIEVEMENT` | 성취 |
| `INTEREST` | 흥미 |
| `PEACE` | 평온 |
| `PLEASURE` | 즐거움 |
| `SADNESS` | 슬픔 |
| `ANGER` | 분노 |
| `WILL` | 의지 |
| `DEPRESSION` | 우울 |
| `REGRET` | 후회 |
| `FRUSTRATION` | 좌절 |
| `GROWTH` | 성장 |
| `ETC` | 기타 |
""",
security = @SecurityRequirement(name = "bearerAuth"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,4 @@ public class Emotion {
@Enumerated(EnumType.STRING)
@Column(name = "name",nullable = false, length = 50)
private EmotionName name;

@Column(name = "color_code", length = 50)
private String colorCode;
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package com.devkor.ifive.nadab.domain.dailyreport.core.entity;

public enum EmotionCode {
JOY,
ACHIEVEMENT,
INTEREST,
PEACE,
PLEASURE,
LOVE,
SADNESS,
ANGER,
PAIN,
WILL,
DEPRESSION,
REGRET,
FRUSTRATION,
GROWTH,
ETC
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package com.devkor.ifive.nadab.domain.dailyreport.core.entity;

public enum EmotionName {
기쁨,
성취,
흥미,
평온,
즐거움,
사랑,
슬픔,
분노,
고통,
의지,
우울,
후회,
좌절,
성장,
기타
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
-- color_code 컬럼 삭제
ALTER TABLE emotions
DROP COLUMN IF EXISTS color_code;


-- 새로운 emotions 레코드들 생성
-- (기존에 존재하는 '즐거움', '후회', '기타'를 제외한 신규 감정만 추가)
INSERT INTO emotions (code, name) VALUES
('ACHIEVEMENT', '성취'),
('INTEREST', '흥미'),
('PEACE', '평온'),
('WILL', '의지'),
('DEPRESSION', '우울');


-- 2. 삭제 예정인 감정들의 emotion_id를 '기타(ETC)'의 id로 변경
-- 삭제 대상: 기쁨(JOY), 슬픔(SADNESS), 분노(ANGER), 좌절(FRUSTRATION), 성장(GROWTH)
UPDATE daily_reports
SET emotion_id = (
SELECT id
FROM emotions
WHERE code = 'ETC'
)
WHERE emotion_id IN (
SELECT id
FROM emotions
WHERE code IN ('JOY', 'SADNESS', 'ANGER', 'FRUSTRATION', 'GROWTH')
);


-- 겹치지 않는(삭제 예정인) emotions 레코드 삭제
DELETE FROM emotions
WHERE code IN ('JOY', 'SADNESS', 'ANGER', 'FRUSTRATION', 'GROWTH');