Skip to content

[Fix/#277] main Flyway 마이그레이션 V33·V34 버전 중복 해결 - #278

Merged
tnals0924 merged 1 commit into
mainfrom
fix/#277-flyway-version-duplicate
Nov 4, 2026
Merged

tnals0924 merged 1 commit into
mainfrom
fix/#277-flyway-version-duplicate

Conversation

@tnals0924

Copy link
Copy Markdown
Member

#️⃣연관된 이슈

🎯 해결하려는 문제가 무엇인가요?

main에 Flyway 버전 V33·V34가 두 개씩 있습니다. #210(이메일 인증) 브랜치가 쓰던 V33·V34가, 머지 직전 main을 합칠 때(68c53f1) 이미 main에 있던 V33·V34와 겹쳤습니다.

버전 main에 먼저 있던 파일 #210이 가져온 파일
V33 V33__add_conversation_id_to_chat_messages.sql (#96) V33__create_email_verifications_table.sql
V34 V34__create_home_banners_and_apply_sections.sql (#200) V34__add_active_email_unique_to_members.sql

❓ 왜 해결해야 하나요?

Flyway는 같은 버전 파일이 둘이면 Found more than one migration with version 33으로 마이그레이션을 시작하지 않습니다. 지금 main 코드로는 앱이 기동하지 못하고, ddl-auto: validate라 email_verifications 테이블이 없으면 JPA 검증도 실패합니다.

⭐ 어떻게 해결했나요?

#210이 가져온 두 파일만 main 최신(V44) 다음 번호로 옮겼습니다. 파일 내용은 바꾸지 않았습니다.

  • V33__create_email_verifications_table.sql → V45__create_email_verifications_table.sql
  • V34__add_active_email_unique_to_members.sql → V46__add_active_email_unique_to_members.sql

먼저 있던 V33(챗봇)·V34(홈 배너)는 #210 머지 전에 dev 배포에 포함됐던 파일이라 그대로 둡니다. 이메일 두 파일은 중복 때문에 어디에도 적용되지 못했으므로 번호를 바꿔도 체크섬 문제가 없습니다. 테이블을 만든 뒤 회원 컬럼을 추가하는 순서(V45 → V46)도 그대로입니다.

🧩 이 PR의 한계 & 트레이드오프

  • 로컬에 Docker가 꺼져 있어 MySQL 통합 테스트(MySqlIntegrationTest)로 실제 마이그레이션을 돌려 보지는 못했습니다. 마이그레이션 폴더의 버전이 모두 하나씩이고 V44 → V45 → V46으로 이어지는 것만 확인했습니다.
  • dev가 지금 어떤 상태인지([Feat/#209] 회원가입 이메일 등록과 이메일 인증 #210 배포 뒤 기동에 실패했는지)는 배포 화면에서 확인하지 못했습니다. GitHub Actions의 Deploy Dev는 Coolify 호출만 하므로 성공으로 찍혀 있습니다.

⛓️ 기존 기능에 미치는 영향

🔀 Edge Case & 실패 시나리오

  • dev DB가 V44까지 적용된 상태라면 이 PR 배포 때 V45·V46이 이어서 적용됩니다.
  • feat/#209-email-verification 브랜치로 로컬 DB에 이메일 마이그레이션을 V33·V34로 이미 적용했다면, flyway_schema_history의 V33·V34 설명이 main 파일과 달라 검증이 실패합니다. 그 경우 로컬 DB를 다시 만들어야 합니다.

📋 검토한 대안과 선택 이유

  • 먼저 있던 V33·V34(챗봇·홈 배너) 쪽을 옮기기: 이미 dev에 적용된 버전이라 번호를 바꾸면 dev의 flyway_schema_history와 어긋납니다.
  • outOfOrder를 켜기: 버전이 겹치는 문제는 해결되지 않고, 머지 순서대로 번호를 올리는 지금 규칙(flyway-migration.md 2절)과도 맞지 않습니다.

💬 리뷰 포인트

  • [r] main이 기동하지 못하는 상태라 먼저 머지가 필요합니다.
  • [c] 마이그레이션이 있는 열린 PR들이 이 PR 머지 뒤 V47부터 번호를 맞춰야 합니다.

@coderabbitai

coderabbitai Bot commented Nov 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Files selected but had no reviewable changes: 2
  • infrastructure/db/src/main/resources/db/migration/V45__create_email_verifications_table.sql
  • infrastructure/db/src/main/resources/db/migration/V46__add_active_email_unique_to_members.sql
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 3d6e90a and cccaf27.

Files selected for processing: 2
  • infrastructure/db/src/main/resources/db/migration/V45__create_email_verifications_table.sql
  • infrastructure/db/src/main/resources/db/migration/V46__add_active_email_unique_to_members.sql

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@tnals0924
tnals0924 merged commit 8332e03 into main Nov 4, 2026
2 checks passed
@tnals0924
tnals0924 deleted the fix/#277-flyway-version-duplicate branch November 4, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

main Flyway 마이그레이션 V33·V34 버전 중복

2 participants