From fd51512f1d0198e32e445bfecedf60587d597cf0 Mon Sep 17 00:00:00 2001 From: 1Seob Date: Thu, 1 Jan 2026 02:47:29 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20emotions=20=ED=85=8C=EC=9D=B4?= =?UTF-8?q?=EB=B8=94=EC=97=90=EC=84=9C=20'=EC=82=AC=EB=9E=91',=20'?= =?UTF-8?q?=EA=B3=A0=ED=86=B5'=EC=97=90=20=ED=95=B4=EB=8B=B9=ED=95=98?= =?UTF-8?q?=EB=8A=94=20=EB=A0=88=EC=BD=94=EB=93=9C=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dailyreport/api/DailyReportController.java | 2 -- ...aily_reports_emotion_and_remove_love_pain.sql | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 src/main/resources/db/migration/V20260101_0234__IS_replace_daily_reports_emotion_and_remove_love_pain.sql diff --git a/src/main/java/com/devkor/ifive/nadab/domain/dailyreport/api/DailyReportController.java b/src/main/java/com/devkor/ifive/nadab/domain/dailyreport/api/DailyReportController.java index 4bd49a3..c7d0387 100644 --- a/src/main/java/com/devkor/ifive/nadab/domain/dailyreport/api/DailyReportController.java +++ b/src/main/java/com/devkor/ifive/nadab/domain/dailyreport/api/DailyReportController.java @@ -99,10 +99,8 @@ public ResponseEntity> generateDailyRepo | :--- | :--- | | `JOY` | 기쁨 | | `PLEASURE` | 즐거움 | - | `LOVE` | 사랑 | | `SADNESS` | 슬픔 | | `ANGER` | 분노 | - | `PAIN` | 고통 | | `REGRET` | 후회 | | `FRUSTRATION` | 좌절 | | `GROWTH` | 성장 | diff --git a/src/main/resources/db/migration/V20260101_0234__IS_replace_daily_reports_emotion_and_remove_love_pain.sql b/src/main/resources/db/migration/V20260101_0234__IS_replace_daily_reports_emotion_and_remove_love_pain.sql new file mode 100644 index 0000000..f9eaadf --- /dev/null +++ b/src/main/resources/db/migration/V20260101_0234__IS_replace_daily_reports_emotion_and_remove_love_pain.sql @@ -0,0 +1,16 @@ +-- 1) daily_reports.emotion_id 를 '기타(ETC)'로 치환 +UPDATE daily_reports +SET emotion_id = ( + SELECT id + FROM emotions + WHERE code = 'ETC' +) +WHERE emotion_id IN ( + SELECT id + FROM emotions + WHERE code IN ('LOVE', 'PAIN') +); + +-- 2) emotions에서 '사랑(LOVE)', '고통(PAIN)' 레코드 삭제 +DELETE FROM emotions +WHERE code IN ('LOVE', 'PAIN'); \ No newline at end of file