refactor: Flyway baseline 재작성 및 로컬 DB 실행 환경 추가#2290
Conversation
|
Important Review skippedToo many files! This PR contains 240 files, which is 90 over the limit of 150. To get a review, narrow the scope: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (240)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Soundbar91
left a comment
There was a problem hiding this comment.
확인했습니다. 혹시 모를 상황에 방어 로직을 넣어도 괜찮을 거 같아요.
CREATE TABLE IF NOT EXISTS `abtest_variable` (
...
);
BaeJinho4028
left a comment
There was a problem hiding this comment.
@Soundbar91
IF NOT EXISTS를 넣으면, 실수로 운영 DB에서 V1이 실행됐을 때 실패하지 않고 지나갈 수 있습니다.
Flyway history 검사도 있으니 굳이 추가하지 않아도 괜찮을 것 같습니다👍
🔍 개요
🚀 주요 변경 내용
현재 MySQL 스키마 기준
V1__baseline_schema.sql추가idx_lecture_code_semester인덱스는 baseline에서 제외기존 Flyway migration 파일을 legacy 경로로 이동
src/main/resources/db/migration/V1~V236__*.sqlsrc/main/resources/db/legacy-migration/기존 cleanup SQL을 legacy 경로로 이동
src/main/resources/db/cleanup/drop_idx_lecture_code_semester.sqlsrc/main/resources/db/legacy-cleanup/drop_idx_lecture_code_semester.sql로컬 개발용 Docker Compose 추가
8.0.297.0.98.2.3133061637927018로컬 실행용
application-local.yml추가💬 참고 사항
flyway_schema_history가 존재하므로, 단순 배포만으로는 baseline reset이 완료되지 않습니다.flyway_schema_history를 백업/rename한 뒤 새 앱을 기동해야 합니다.V1__baseline_schema.sql이 실행되는 것이 아니라,baseline-on-migrate=true에 의해version=1/type=BASELINE기록만 생성되는 것을 기대합니다.V1__baseline_schema.sql이 실제 실행됩니다.docker compose config성공SPRING_PROFILES_ACTIVE=local앱 기동 성공/actuator/health응답UP./gradlew test성공✅ Checklist (완료 조건)