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 @@ -8,6 +8,7 @@ public enum LanguageTestType {
JLPT(Comparator.reverseOrder()),
DALF(LanguageTestType::compareIntegerScores),
DELF(LanguageTestType::compareIntegerScores),
DELE(String::compareTo),
DUOLINGO(LanguageTestType::compareIntegerScores),
IELTS(LanguageTestType::compareDoubleScores),
NEW_HSK(LanguageTestType::compareIntegerScores),
Expand Down
17 changes: 17 additions & 0 deletions src/main/resources/db/migration/V31__add_DELE_Language_test.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
ALTER TABLE application
MODIFY COLUMN language_test_type ENUM(
'CEFR',
'DALF',
'DELF',
'DELE',
'DUOLINGO',
'IELTS',
'JLPT',
'NEW_HSK',
'TCF',
'TEF',
'TOEFL_IBT',
'TOEFL_ITP',
'TOEIC',
'ETC'
);
Comment on lines +1 to +17
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

3) CEFR → DELE 데이터 마이그레이션을 코드로 남겨 주세요.
운영 DB에서 수동 변경 대신, 후속 버전 마이그레이션으로 재현 가능하게 관리하는 것을 권장합니다.

예시(별도 파일 V31_1에 추가 권장, 조건은 실제 키로 교체):

-- V31_1__migrate_application_language_test_to_DELE.sql
START TRANSACTION;
-- 대상 행 확인(드라이런)
SELECT id, university_id, language_test_type FROM application
 WHERE /* TODO: 대상 대학 조건 */ AND language_test_type = 'CEFR' FOR UPDATE;

-- 실제 업데이트
UPDATE application
   SET language_test_type = 'DELE'
 WHERE /* TODO: 대상 대학 조건 */ AND language_test_type = 'CEFR';
COMMIT;

원하시면 조건 식별 및 스크립트 작성까지 도와드릴게요.

🤖 Prompt for AI Agents
In src/main/resources/db/migration/V31__add_DELE_Language_test.sql around lines
1 to 17: the review requests a follow-up migration to migrate existing rows with
language_test_type='CEFR' to 'DELE' instead of doing it manually; create a new
migration file (e.g., V31_1__migrate_application_language_test_to_DELE.sql) that
runs in a transaction, first SELECT ... FOR UPDATE to verify target rows (with
the actual university/condition replacing the TODO placeholder), then UPDATE
those rows setting language_test_type='DELE', and COMMIT; ensure the file
name/version sorts after V31 and replace all TODOs with the real selection
criteria/keys before applying to production.

💡 Verification agent

🧩 Analysis chain

1) MySQL ENUM 수정 시 NULL/DEFAULT/COMMENT 유실 위험을 방지해 주세요.
MODIFY COLUMN은 전체 정의를 재기술해야 하므로 기존의 NOT NULL/DEFAULT/COMMENT가 빠질 수 있습니다. 운영 스키마와 동일하게 명시해 주세요.

    1. 현재 컬럼의 Null 여부와 기본값을 확인해 동일하게 유지해 주세요.
    1. 가능하면 COMMENT로 코드 enum과의 동기화 주석을 남겨 주세요.

예시(필요 시 조정):

 ALTER TABLE application
-    MODIFY COLUMN language_test_type ENUM(
+    MODIFY COLUMN language_test_type ENUM(
     'CEFR',
     'DALF',
     'DELF',
     'DELE',
     'DUOLINGO',
     'IELTS',
     'JLPT',
     'NEW_HSK',
     'TCF',
     'TEF',
     'TOEFL_IBT',
     'TOEFL_ITP',
     'TOEIC',
     'ETC'
-    );
+    ) NOT NULL
+      COMMENT '어학시험 타입. 코드의 LanguageTestType와 동기화';

빠른 점검 스크립트(개발 DB에서 실행 권장):


🏁 Script executed:

#!/bin/bash
# language_test_type 현재 정의 확인
mysql -e "SHOW CREATE TABLE application\G" | sed -n '/language_test_type/p'

Length of output: 171


🏁 Script executed:

#!/bin/bash
rg -n "language_test_type" -C3 src/main/resources/db/migration

Length of output: 3566


🏁 Script executed:

#!/bin/bash
# V1__init.sql 첫 번째 테이블 생성 부분 확인
sed -n '1,50p' src/main/resources/db/migration/V1__init.sql

#  두 번째 테이블(또는 이후) 생성 부분 확인
sed -n '50,100p' src/main/resources/db/migration/V1__init.sql

Length of output: 3516


ALTER TABLE에 NOT NULL과 COMMENT 명시

  1. NULL 제약 유지

    • 기존 application.language_test_type 컬럼이 NOT NULL으로 선언되어 있으므로, MODIFY COLUMN 절에 NOT NULL을 추가하세요.
  2. COMMENT 추가

    • 코드의 LanguageTestType enum과 동기화를 위해 COMMENT '어학시험 타입. 코드의 LanguageTestType와 동기화'를 달아 주세요.
🤖 Prompt for AI Agents
In src/main/resources/db/migration/V31__add_DELE_Language_test.sql around lines
1 to 17, the ALTER TABLE MODIFY COLUMN statement omits the original NOT NULL
constraint and a descriptive COMMENT; update the MODIFY COLUMN to explicitly
include NOT NULL and add COMMENT '어학시험 타입. 코드의 LanguageTestType와 동기화' so the
column preserves its non-null constraint and documents synchronization with the
LanguageTestType enum.

Loading