[FEATURE] Flyway 설정 추가#121
Conversation
|
Warning Review limit reached
Next review available in: 52 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughFlyway 의존성과 초기 MySQL 스키마 마이그레이션을 추가하고, 환경별 Hibernate 스키마 처리를 ChangesFlyway 스키마 및 테스트 전환
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant SpringBoot
participant Flyway
participant MySQL
participant Hibernate
SpringBoot->>Flyway: 설정 로드
Flyway->>MySQL: V1__init.sql 실행
MySQL-->>Flyway: 초기 스키마 생성
SpringBoot->>Hibernate: 엔티티 스키마 검증
Hibernate->>MySQL: 매핑과 스키마 비교
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
src/main/resources/application.yaml (1)
16-22: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win프로덕션 환경에서
out-of-order: true설정을 재검토해 주세요.
out-of-order: true는 공용 설정이므로 프로덕션 프로파일에도 적용됩니다. 병렬 브랜치에서 서로 다른 마이그레이션 버전이 생성될 경우, 순서와 무관하게 적용되어 스키마 불일치가 발생할 수 있습니다. 프로덕션에서는false로 설정하고, 로컬 개발 환경에서만true를 허용하는 것을 권장합니다.♻️ 제안: application-prod.yaml에 오버라이드 추가
spring: flyway: out-of-order: false🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/main/resources/application.yaml` around lines 16 - 22, Update the Flyway configuration so production overrides the shared out-of-order setting to false, while retaining true only for local development profiles. Use the existing application-prod.yaml configuration and the flyway.out-of-order property; keep the shared setting unchanged if local environments depend on it.src/main/resources/db/migration/V1__init.sql (1)
343-358: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winnotification_outboxes 테이블에 outbox 폴링용 복합 인덱스가 누락되었습니다.
Outbox 패턴에서는 일반적으로
SELECT ... WHERE status = 'PENDING' AND scheduled_at <= NOW() ORDER BY scheduled_at LIMIT N쿼리로 미발송 알림을 폴링합니다.(status, scheduled_at)복합 인덱스가 없으면 풀 테이블 스캔이 발생하여 데이터가 쌓일수록 성능이 저하됩니다.♻️ 제안: 복합 인덱스 추가
PRIMARY KEY (notification_outbox_id) + , + KEY idx_notification_outboxes_status_scheduled_at (status, scheduled_at) );🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/main/resources/db/migration/V1__init.sql` around lines 343 - 358, notification_outboxes 테이블 정의에 outbox 폴링 쿼리를 지원하는 (status, scheduled_at) 복합 인덱스를 추가하세요. 기존 컬럼과 기본 키 정의는 유지하고, status 조건·scheduled_at 범위 및 정렬에 활용되도록 테이블 생성문에 인덱스를 선언하세요.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@build.gradle`:
- Around line 72-76: Restore the `testImplementation
'org.springframework.boot:spring-boot-starter-test'` dependency in the test
dependency declarations so the existing `src/test/java` tests receive JUnit
Jupiter, AssertJ, and Mockito. Keep the current
`spring-boot-starter-webmvc-test` and other test dependencies unchanged.
---
Nitpick comments:
In `@src/main/resources/application.yaml`:
- Around line 16-22: Update the Flyway configuration so production overrides the
shared out-of-order setting to false, while retaining true only for local
development profiles. Use the existing application-prod.yaml configuration and
the flyway.out-of-order property; keep the shared setting unchanged if local
environments depend on it.
In `@src/main/resources/db/migration/V1__init.sql`:
- Around line 343-358: notification_outboxes 테이블 정의에 outbox 폴링 쿼리를 지원하는 (status,
scheduled_at) 복합 인덱스를 추가하세요. 기존 컬럼과 기본 키 정의는 유지하고, status 조건·scheduled_at 범위 및
정렬에 활용되도록 테이블 생성문에 인덱스를 선언하세요.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro Plus
Run ID: 467cbc7a-9fb7-40a8-935d-930f68513dfa
📒 Files selected for processing (18)
build.gradlesrc/main/java/ditda/backend/domain/commission/category/textbook/entity/TextbookPage.javasrc/main/java/ditda/backend/domain/commission/core/entity/CommissionColor.javasrc/main/java/ditda/backend/domain/commission/core/entity/CommissionConcept.javasrc/main/java/ditda/backend/domain/commission/draft/entity/CommissionDraft.javasrc/main/java/ditda/backend/domain/commission/draft/entity/CommissionDraftFile.javasrc/main/java/ditda/backend/domain/commission/revision/entity/RevisionRequest.javasrc/main/java/ditda/backend/domain/commission/revision/entity/RevisionResponse.javasrc/main/java/ditda/backend/domain/settlement/entity/Settlement.javasrc/main/java/ditda/backend/domain/user/entity/User.javasrc/main/resources/application-local.yamlsrc/main/resources/application-prod.yamlsrc/main/resources/application.yamlsrc/main/resources/db/migration/V1__init.sqlsrc/test/java/ditda/backend/BackendApplicationTests.javasrc/test/java/ditda/backend/support/IntegrationTestSupport.javasrc/test/java/ditda/backend/support/TestcontainersConfiguration.javasrc/test/resources/application-test.yaml
🚀 Related issue
Closes #118
#️⃣ Summary
V1__init.sql)로 버전 관리합니다.🔧 Changes
db/migration/V1__init.sql)update->validate전환H2->Testcontainers(MySQL)로 교체📸 Test Evidence
💬 Reviewer Notes
개발 컨벤션/코딩 스타일참고 부탁드립니다!Testcontainers를 이용해 테스트 하도록 변경했습니다.Summary by CodeRabbit