hotfix: 운영 notification FCM 컬럼 누락 복구 (develop)#2311
Closed
taejinn wants to merge 3 commits into
Closed
Conversation
hotfix: 영양사 페이지 이미지 다운로드 실패 수정 (main)
release: 2026.07.21 배포
📝 WalkthroughWalkthroughAdds a repeatable Flyway migration that restores missing FCM columns on ChangesNotification FCM schema repair
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
DHkimgit
approved these changes
Jul 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
⚡ 간단 요약
V236적용 후 baseline으로 전환됐지만, production은V236없이 baseline으로 전환되어notification의 FCM 컬럼 3개가 누락됐고 애플리케이션이 기동하지 못했습니다.🔍 문제 발생 배경
notification테이블에 다음 컬럼을 추가하는V236migration이 반영되었습니다.is_push_successfcm_error_codefcm_messaging_error_codeV1__baseline_schema.sql을 생성하고 기존 V1–V236 migration을 실행 경로에서 제외했습니다. 따라서 새 V1 파일에는 세 컬럼이 포함되어 있지만, production의 실제 테이블에는 아직 존재하지 않는 상태가 됐습니다.missing column [fcm_error_code] in table [notification]오류로 기동에 실패했습니다.이 PR은 production 복구용 hotfix와 동일한 변경을 develop에도 반영해, 이후 release에서 수정이 유실되거나 서로 다른 migration 정책이 생기지 않도록 하기 위한 PR입니다.
🚨 원인 정리
이 문제는 V1 baseline 파일의 컬럼 정의가 잘못된 것이 아니라, baseline 생성 기준이었던 stage와 전환 대상인 production의 migration 적용 상태가 달랐던 것이 원인입니다.
baseline-on-migrate=true에 의해 V1 SQL은 실행되지 않음따라서 현재 필요한 작업은 새로운 기능을 위한 스키마 변경이 아니라, production 스키마를 이미 선언된 V1 baseline 상태와 일치시키는 복구 작업입니다.
🧭 해결 방법 검토
V236을 다시 migration 경로에 추가V5versioned migration 추가outOfOrder=true로 낮은 버전 실행 허용현재 분리된 migration 이력을 변경하지 않으면서 모든 환경에서 같은 파일을 안전하게 실행할 수 있다는 점에서 repeatable migration이 가장 영향 범위가 작고 재현 가능한 방법이라고 판단했습니다.
✅ 선택한 해결 방법
R__ensure_notification_fcm_columns.sql을 추가합니다.information_schema.COLUMNS에서 필요한 세 컬럼의 존재 여부를 확인합니다.ALTER TABLE ... ALGORITHM=INSTANT로 추가합니다.DO 0으로 종료합니다.ALGORITHM=INSTANT를 명시해 MySQL이 테이블 복사 방식으로 자동 전환하지 않고, instant ADD COLUMN을 지원하지 않는 조건에서는 즉시 실패하도록 했습니다. 세 컬럼은 모두 nullable이므로 기존 운영 애플리케이션과도 하위 호환됩니다.🌍 환경별 동작
🧪 검증
MySQL 8.0.29와 실제 사용 중인 Flyway 9.16.3 조합으로 다음을 검증했습니다.
migrate()실행 시 중복 적용 없음flyway_schema_history기록 확인DepartmentContactMigrationTest와 신규 migration 테스트 동시 실행검증 명령:
./gradlew test --tests in.koreatech.koin.acceptance.migration.NotificationFcmMigrationTest --tests in.koreatech.koin.acceptance.migration.DepartmentContactMigrationTest./gradlew buildGitHub build, Flyway version 검사, 위험 SQL 검사, PR 제목 검사도 모두 통과했으며 CodeRabbit에서도 actionable comment가 없었습니다.
💬 반영 방식
hotfix/2309-notification-fcm-columns브랜치에서 main PR과 develop PR을 각각 생성했습니다.BEHIND표시는 main에서 분기한 동일 hotfix 브랜치를 사용하는 기존 hotfix 방식에 따른 것입니다. main PR이 열려 있는 동안 develop을 hotfix 브랜치에 병합하면 main PR에 미배포 develop 변경이 섞이므로 Update branch를 수행하지 않습니다.✅ Checklist (완료 조건)