Conversation
- 가장 먼저 리뷰 가능한 최소 기능 단위로 event/event_program 스키마와 프로그램 조회 API만 남겼다 - 홈, 부스, 맵, 미니 이벤트, 콘텐츠를 제외해 첫 stacked PR 크기를 346줄로 줄였다 - 이후 PR이 이 기반 위에 수직으로 쌓이도록 controller/service/dto를 프로그램 조회 중심으로 정리했다
- stacked branch 재구성 과정에서 빠진 NOT_FOUND_EVENT를 다시 추가한다 - event service가 기존 예외 계약을 그대로 사용하도록 맞춰 pre-push compile 실패를 막는다 - 이후 stacked PR 전체가 공통 응답 코드를 안정적으로 공유하도록 기반 브랜치에서 먼저 복구한다
📝 WalkthroughWalkthrough이 PR은 이벤트 프로그램 조회 기능을 구현합니다. 페이지네이션과 필터링을 지원하는 API 엔드포인트, JPA 엔티티, 저장소, 서비스 계층, DTO, 열거형, 그리고 데이터베이스 마이그레이션을 추가합니다. Changes
Sequence DiagramsequenceDiagram
actor Client
participant Controller as EventController
participant Service as EventService
participant EventRepo as EventRepository
participant ProgramRepo as EventProgramRepository
participant DB as Database
Client->>Controller: GET /events/{eventId}/programs
activate Controller
Controller->>Service: getEventPrograms(eventId, type, page, limit, userId)
activate Service
Service->>EventRepo: findById(eventId)
activate EventRepo
EventRepo->>DB: SELECT * FROM event WHERE id = ?
DB-->>EventRepo: Event
deactivate EventRepo
EventRepo-->>Service: Optional<Event>
Service->>ProgramRepo: findAllByEventIdOrderByDisplayOrderAscIdAsc(eventId)
activate ProgramRepo
ProgramRepo->>DB: SELECT * FROM event_program WHERE event_id = ? ORDER BY display_order ASC, id ASC
DB-->>ProgramRepo: List<EventProgram>
deactivate ProgramRepo
ProgramRepo-->>Service: List<EventProgram>
Service->>Service: filterByType(programs, type)
Service->>Service: paginate(filteredPrograms, page, limit)
Service->>Service: mapToSummaryResponses(paginatedPrograms)
Service-->>Controller: EventProgramsResponse
deactivate Service
Controller-->>Client: ResponseEntity<EventProgramsResponse>
deactivate Controller
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
🧪 JaCoCo Coverage Report (Changed Files)Summary
Coverage by File
|
There was a problem hiding this comment.
Actionable comments posted: 7
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/main/java/gg/agit/konect/domain/event/controller/EventApi.java`:
- Around line 25-26: Add an upper bound to the "limit" request parameter to
prevent excessive memory usage: update the EventApi controller parameter
annotation for the method using "limit" to include a `@Max` constraint (e.g.,
`@Max`(100)) or reference a shared paging constant (e.g.,
PagingConstants.MAX_LIMIT) instead of a hardcoded value; ensure the import for
javax.validation.constraints.Max is present and the parameter declaration for
"limit" (currently `@RequestParam`(defaultValue = "20") `@Min`(1) Integer limit) is
changed to include `@Max` so the framework rejects overly large requests before
processing.
In `@src/main/java/gg/agit/konect/domain/event/enums/EventProgramType.java`:
- Around line 3-6: The EventProgramType enum currently includes ALL which does
not exist in the DB enum (migration V70__add_event_tables.sql defines only
'POINT' and 'RESONANCE'), causing integrity errors when persisting; fix by
either (A) remove API/filter-only value ALL from the persistent enum and create
a separate API-facing enum (e.g., EventProgramFilterType) used only for
filtering, or (B) keep EventProgramType for persistence (only POINT, RESONANCE)
and explicitly block/translate ALL before any save/update path (check
controllers/services that accept EventProgramType), updating usages of
EventProgramType and any save logic in EventProgram-related service methods so
only valid DB values are persisted.
In `@src/main/java/gg/agit/konect/domain/event/model/EventProgram.java`:
- Around line 37-39: The EventProgram.entity field "type" currently uses
EventProgramType (which contains API-only value ALL) causing DB enum mismatch;
change the persistence model to use a dedicated enum that only contains storable
values (e.g., EventProgramPersistentType with POINT and RESONANCE) and update
the field in EventProgram to that enum (or add a JPA AttributeConverter between
EventProgramType and EventProgramPersistentType). Keep the API/filter enum
(EventProgramType or rename to EventProgramFilterType) for request handling, and
perform explicit mapping in controller/service code when persisting or querying
so that API-only values like ALL are not written to the DB.
In
`@src/main/java/gg/agit/konect/domain/event/repository/EventProgramRepository.java`:
- Around line 11-13: The repository currently exposes
findAllByEventIdOrderByDisplayOrderAscIdAsc which forces in-memory type
filtering and pagination; update EventProgramRepository to add a DB-filtered,
pageable query such as Page<EventProgram>
findByEventIdAndTypeOrderByDisplayOrderAscIdAsc(Integer eventId,
EventProgramType type, Pageable pageable), and ensure Page and Pageable
(org.springframework.data.domain) and EventProgramType are imported/available so
callers can request DB-side filtering and pagination instead of loading all
results into memory.
In `@src/main/java/gg/agit/konect/domain/event/service/EventService.java`:
- Around line 32-37: The current EventService loads all programs via
eventProgramRepository.findAllByEventIdOrderByDisplayOrderAscIdAsc and then
applies in-memory filtering and paginate, causing performance and GC issues;
change this to push filtering and paging into the repository by adding/using a
method that accepts eventId, type (handle EventProgramType.ALL by calling a
no-type variant or using dynamic query) and a Pageable, e.g.,
findByEventIdAndTypeOrderByDisplayOrderAscIdAsc or
findByEventIdOrderByDisplayOrderAscIdAsc(Pageable), have it return a
Page<EventProgram> (so DB computes the count) and update EventService to call
that repository method and remove the in-memory filter + paginate usage so
PagedResult is constructed from the Page content and total elements returned by
the DB.
In `@src/main/resources/db/migration/V70__add_event_tables.sql`:
- Around line 18-25: Add a composite index to the event_program table to cover
the common query pattern filtering by event_id and ordering by display_order and
id: create index idx_event_program_event_order on event_program(event_id,
display_order, id). Modify the V70__add_event_tables.sql migration to include
this INDEX declaration alongside the event_program table definition (or as a
separate CREATE INDEX statement within the same migration) so that queries using
event_id + ORDER BY display_order, id avoid filesort and scale efficiently.
- Around line 1-2: Remove the "IF NOT EXISTS" from the versioned Flyway
migration CREATE TABLE statement so the migration fails on schema drift;
specifically update the SQL in V70__add_event_tables.sql by changing "CREATE
TABLE IF NOT EXISTS event" to "CREATE TABLE event" (and remove any other "IF NOT
EXISTS" occurrences around the event table creation referenced at lines 15-16),
ensuring any intentional conditional behavior is handled in a separate
repeatable/corrective migration.
🪄 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.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: bdd49587-a591-4066-9e48-abdde2ac0726
📒 Files selected for processing (14)
src/main/java/gg/agit/konect/domain/event/controller/EventApi.javasrc/main/java/gg/agit/konect/domain/event/controller/EventController.javasrc/main/java/gg/agit/konect/domain/event/dto/EventProgramSummaryResponse.javasrc/main/java/gg/agit/konect/domain/event/dto/EventProgramsResponse.javasrc/main/java/gg/agit/konect/domain/event/enums/EventProgramType.javasrc/main/java/gg/agit/konect/domain/event/enums/EventProgressStatus.javasrc/main/java/gg/agit/konect/domain/event/enums/EventStatus.javasrc/main/java/gg/agit/konect/domain/event/model/Event.javasrc/main/java/gg/agit/konect/domain/event/model/EventProgram.javasrc/main/java/gg/agit/konect/domain/event/repository/EventProgramRepository.javasrc/main/java/gg/agit/konect/domain/event/repository/EventRepository.javasrc/main/java/gg/agit/konect/domain/event/service/EventService.javasrc/main/java/gg/agit/konect/global/code/ApiResponseCode.javasrc/main/resources/db/migration/V70__add_event_tables.sql
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: coverage
- GitHub Check: Analyze (java-kotlin)
🧰 Additional context used
📓 Path-based instructions (3)
src/main/java/**/*.java
⚙️ CodeRabbit configuration file
src/main/java/**/*.java: 아래 원칙으로 리뷰 코멘트를 작성한다.
- 코멘트는 반드시 한국어로 작성한다.
- 반드시 수정이 필요한 항목만 코멘트로 남기고, 단순 취향 차이는 지적하지 않는다.
- 각 코멘트 첫 줄에 심각도를
[LEVEL: high|medium|low]형식으로 반드시 표기한다.- 심각도 기준: high=운영 장애 가능, medium=품질 저하, low=개선 권고.
- 각 코멘트는 "문제 -> 영향 -> 제안" 순서로 3문장 이내로 간결하게 작성한다.
- 가능하면 재현 조건 및 실패 시나리오도 포함한다.
- 제안은 현재 코드베이스(Spring Boot + JPA + Flyway) 패턴과 일치해야 한다.
- 보안, 트랜잭션 경계, 예외 처리, N+1, 성능 회귀 가능성을 우선 점검한다.
- 가독성: 변수/메서드 이름이 의도를 바로 드러내는지, 중첩과 메서드 길이가 과도하지 않은지 점검한다.
- 단순화: 불필요한 추상화, 중복 로직, 과한 방어 코드가 있으면 더 단순한 대안을 제시한다.
- 확장성: 새 요구사항 추가 시 변경 범위가 최소화되는 구조인지(하드코딩 분기/값 여부 포함) 점검한다.
Files:
src/main/java/gg/agit/konect/domain/event/enums/EventProgramType.javasrc/main/java/gg/agit/konect/domain/event/enums/EventStatus.javasrc/main/java/gg/agit/konect/domain/event/enums/EventProgressStatus.javasrc/main/java/gg/agit/konect/global/code/ApiResponseCode.javasrc/main/java/gg/agit/konect/domain/event/repository/EventRepository.javasrc/main/java/gg/agit/konect/domain/event/dto/EventProgramSummaryResponse.javasrc/main/java/gg/agit/konect/domain/event/controller/EventController.javasrc/main/java/gg/agit/konect/domain/event/dto/EventProgramsResponse.javasrc/main/java/gg/agit/konect/domain/event/controller/EventApi.javasrc/main/java/gg/agit/konect/domain/event/repository/EventProgramRepository.javasrc/main/java/gg/agit/konect/domain/event/service/EventService.javasrc/main/java/gg/agit/konect/domain/event/model/EventProgram.javasrc/main/java/gg/agit/konect/domain/event/model/Event.java
**/*
⚙️ CodeRabbit configuration file
**/*: 공통 리뷰 톤 가이드:
- 모든 코멘트는 첫 줄에
[LEVEL: ...]태그를 포함한다.- 과장된 표현 없이 사실 기반으로 작성한다.
- 한 코멘트에는 하나의 이슈만 다룬다.
- 코드 예시가 필요하면 최소 수정 예시를 제시한다.
- 가독성/단순화/확장성 이슈를 발견하면 우선순위를 높여 코멘트한다.
Files:
src/main/java/gg/agit/konect/domain/event/enums/EventProgramType.javasrc/main/java/gg/agit/konect/domain/event/enums/EventStatus.javasrc/main/java/gg/agit/konect/domain/event/enums/EventProgressStatus.javasrc/main/java/gg/agit/konect/global/code/ApiResponseCode.javasrc/main/java/gg/agit/konect/domain/event/repository/EventRepository.javasrc/main/java/gg/agit/konect/domain/event/dto/EventProgramSummaryResponse.javasrc/main/java/gg/agit/konect/domain/event/controller/EventController.javasrc/main/java/gg/agit/konect/domain/event/dto/EventProgramsResponse.javasrc/main/java/gg/agit/konect/domain/event/controller/EventApi.javasrc/main/java/gg/agit/konect/domain/event/repository/EventProgramRepository.javasrc/main/java/gg/agit/konect/domain/event/service/EventService.javasrc/main/java/gg/agit/konect/domain/event/model/EventProgram.javasrc/main/java/gg/agit/konect/domain/event/model/Event.javasrc/main/resources/db/migration/V70__add_event_tables.sql
src/main/resources/db/migration/**/*.sql
⚙️ CodeRabbit configuration file
src/main/resources/db/migration/**/*.sql: Flyway 마이그레이션 리뷰 규칙:
- 버전 파일명 규칙(V{number}__{description}.sql) 위반 여부를 우선 확인한다.
- 이미 배포된 마이그레이션 수정/재번호 부여 위험이 있으면 반드시 차단 코멘트를 남긴다.
- 파괴적 변경(drop, rename 등)은 롤백 가능성과 운영 영향 관점에서 검토한다.
Files:
src/main/resources/db/migration/V70__add_event_tables.sql
| @RequestParam(defaultValue = "1") @Min(1) Integer page, | ||
| @RequestParam(defaultValue = "20") @Min(1) Integer limit, |
There was a problem hiding this comment.
[LEVEL: medium]
문제: limit 파라미터에 상한 검증이 없어 limit=100000 같은 과도한 요청이 그대로 허용됩니다.
영향: 현재 서비스가 DB 레벨 페이징이 아니라 메모리 기반 페이징을 사용하므로 큰 limit 요청에서 응답 지연과 메모리 사용량 급증으로 이어질 수 있습니다.
제안: @Max(예: 100) 또는 공통 페이징 정책 상수를 추가해 상한을 강제해 주세요, As per coding guidelines, "보안, 트랜잭션 경계, 예외 처리, N+1, 성능 회귀 가능성을 우선 점검한다."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/main/java/gg/agit/konect/domain/event/controller/EventApi.java` around
lines 25 - 26, Add an upper bound to the "limit" request parameter to prevent
excessive memory usage: update the EventApi controller parameter annotation for
the method using "limit" to include a `@Max` constraint (e.g., `@Max`(100)) or
reference a shared paging constant (e.g., PagingConstants.MAX_LIMIT) instead of
a hardcoded value; ensure the import for javax.validation.constraints.Max is
present and the parameter declaration for "limit" (currently
`@RequestParam`(defaultValue = "20") `@Min`(1) Integer limit) is changed to include
`@Max` so the framework rejects overly large requests before processing.
| public enum EventProgramType { | ||
| ALL, | ||
| POINT, | ||
| RESONANCE |
There was a problem hiding this comment.
[LEVEL: medium] DB enum과 도메인 enum 값이 불일치합니다.
Line 4의 ALL은 src/main/resources/db/migration/V70__add_event_tables.sql의 event_program.type ENUM('POINT','RESONANCE')에 없어 EventProgram 저장 시 무결성 예외를 유발할 수 있습니다. 이후 프로그램 생성/수정 기능이 붙으면 런타임 실패 시나리오가 발생합니다. As per coding guidelines "확장성: 새 요구사항 추가 시 변경 범위가 최소화되는 구조인지(하드코딩 분기/값 여부 포함) 점검한다.", API 필터 전용 enum(ALL 포함)과 영속 enum(POINT,RESONANCE)을 분리하거나 저장 전 ALL 유입을 차단하세요.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/main/java/gg/agit/konect/domain/event/enums/EventProgramType.java` around
lines 3 - 6, The EventProgramType enum currently includes ALL which does not
exist in the DB enum (migration V70__add_event_tables.sql defines only 'POINT'
and 'RESONANCE'), causing integrity errors when persisting; fix by either (A)
remove API/filter-only value ALL from the persistent enum and create a separate
API-facing enum (e.g., EventProgramFilterType) used only for filtering, or (B)
keep EventProgramType for persistence (only POINT, RESONANCE) and explicitly
block/translate ALL before any save/update path (check controllers/services that
accept EventProgramType), updating usages of EventProgramType and any save logic
in EventProgram-related service methods so only valid DB values are persisted.
| @Enumerated(STRING) | ||
| @Column(name = "type", nullable = false, length = 20) | ||
| private EventProgramType type; |
There was a problem hiding this comment.
[LEVEL: medium]
문제: 영속 컬럼 type이 API 필터 값 ALL을 포함한 EventProgramType을 그대로 사용해 DB ENUM 정의(POINT, RESONANCE)와 의미가 섞여 있습니다.
영향: 추후 생성/수정 경로에서 type=ALL이 들어오면 SQL enum 불일치로 저장 실패가 발생합니다(재현: EventProgram.type=ALL persist).
제안: DB 매핑용 enum과 조회 필터용 enum을 분리해 영속 계층에는 저장 가능한 값만 남겨 주세요, As per coding guidelines, "확장성: 새 요구사항 추가 시 변경 범위가 최소화되는 구조인지(하드코딩 분기/값 여부 포함) 점검한다."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/main/java/gg/agit/konect/domain/event/model/EventProgram.java` around
lines 37 - 39, The EventProgram.entity field "type" currently uses
EventProgramType (which contains API-only value ALL) causing DB enum mismatch;
change the persistence model to use a dedicated enum that only contains storable
values (e.g., EventProgramPersistentType with POINT and RESONANCE) and update
the field in EventProgram to that enum (or add a JPA AttributeConverter between
EventProgramType and EventProgramPersistentType). Keep the API/filter enum
(EventProgramType or rename to EventProgramFilterType) for request handling, and
perform explicit mapping in controller/service code when persisting or querying
so that API-only values like ALL are not written to the DB.
| List<EventProgram> findAllByEventIdOrderByDisplayOrderAscIdAsc(Integer eventId); | ||
|
|
||
| int countByEventId(Integer eventId); |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# 서비스가 전체 조회 후 메모리 필터/페이지네이션을 수행하는지 확인
rg -n -A8 -B4 'findAllByEventIdOrderByDisplayOrderAscIdAsc|paginate\(|\.filter\(program -> type == EventProgramType.ALL' --type=javaRepository: BCSDLab/KONECT_BACK_END
Length of output: 4573
🏁 Script executed:
# EventProgram 엔티티의 type 필드 및 구조 확인
fd -n 'EventProgram.java' | head -5Repository: BCSDLab/KONECT_BACK_END
Length of output: 297
🏁 Script executed:
# 코드베이스의 Pageable 패턴 사용 사례 확인
rg -n 'Pageable|Page<' --type=java | head -20Repository: BCSDLab/KONECT_BACK_END
Length of output: 2942
🏁 Script executed:
# EventProgram 엔티티 파일 위치 확인 및 내용 검토
fd 'EventProgram.java' --type fRepository: BCSDLab/KONECT_BACK_END
Length of output: 132
🏁 Script executed:
# EventProgram 엔티티의 type 필드 확인
rg -A 20 'public class EventProgram' --type=java | head -40Repository: BCSDLab/KONECT_BACK_END
Length of output: 2082
🏁 Script executed:
# EventService의 getEventPrograms 메서드 전체 서명 및 호출 컨텍스트 확인
rg -B 5 'findAllByEventIdOrderByDisplayOrderAscIdAsc' src/main/java/gg/agit/konect/domain/event/service/EventService.javaRepository: BCSDLab/KONECT_BACK_END
Length of output: 437
🏁 Script executed:
# EventProgramType enum 확인
rg -A 10 'enum EventProgramType' --type=javaRepository: BCSDLab/KONECT_BACK_END
Length of output: 483
🏁 Script executed:
# Repository의 다른 쿼리 메서드들이 Pageable을 어떻게 사용하는지 확인
rg -B 2 -A 4 'Page<' src/main/java/gg/agit/konect/domain/studytime/repository/StudyTimeRankingRepository.java | head -20Repository: BCSDLab/KONECT_BACK_END
Length of output: 629
[LEVEL: medium] 저장소가 타입 필터링과 페이지네이션을 지원하지 않아 메모리 처리를 유도합니다.
findAllByEventIdOrderByDisplayOrderAscIdAsc()는 모든 프로그램을 조회한 후 서비스에서 타입 필터와 페이지 계산을 메모리에서 처리하도록 강제합니다. 데이터가 증가하면 메모리 사용량 증가 및 응답 지연으로 이어질 수 있습니다.
eventId와 type을 매개변수로 받아 DB에서 필터링하고 Pageable을 통해 페이지네이션하는 쿼리 메서드를 추가하세요. (예: Page<EventProgram> findByEventIdAndTypeOrderByDisplayOrderAscIdAsc(Integer eventId, EventProgramType type, Pageable pageable))
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In
`@src/main/java/gg/agit/konect/domain/event/repository/EventProgramRepository.java`
around lines 11 - 13, The repository currently exposes
findAllByEventIdOrderByDisplayOrderAscIdAsc which forces in-memory type
filtering and pagination; update EventProgramRepository to add a DB-filtered,
pageable query such as Page<EventProgram>
findByEventIdAndTypeOrderByDisplayOrderAscIdAsc(Integer eventId,
EventProgramType type, Pageable pageable), and ensure Page and Pageable
(org.springframework.data.domain) and EventProgramType are imported/available so
callers can request DB-side filtering and pagination instead of loading all
results into memory.
| List<EventProgram> filteredPrograms = eventProgramRepository.findAllByEventIdOrderByDisplayOrderAscIdAsc( | ||
| eventId).stream() | ||
| .filter(program -> type == EventProgramType.ALL || program.getType() == type) | ||
| .toList(); | ||
|
|
||
| PagedResult<EventProgram> pagedPrograms = paginate(filteredPrograms, page, limit); |
There was a problem hiding this comment.
[LEVEL: high]
문제: findAllByEventId...로 전체를 읽은 뒤 타입 필터링과 페이징을 메모리에서 처리하고 있습니다.
영향: 프로그램 수가 많은 행사(예: 1만 건)에서 요청마다 전량 로드/정렬이 발생해 지연과 GC 부하로 운영 장애 가능성이 있습니다.
제안: type 조건과 Pageable을 Repository 쿼리로 내리고 count도 DB에서 계산하도록 변경해 주세요, As per coding guidelines, "보안, 트랜잭션 경계, 예외 처리, N+1, 성능 회귀 가능성을 우선 점검한다."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/main/java/gg/agit/konect/domain/event/service/EventService.java` around
lines 32 - 37, The current EventService loads all programs via
eventProgramRepository.findAllByEventIdOrderByDisplayOrderAscIdAsc and then
applies in-memory filtering and paginate, causing performance and GC issues;
change this to push filtering and paging into the repository by adding/using a
method that accepts eventId, type (handle EventProgramType.ALL by calling a
no-type variant or using dynamic query) and a Pageable, e.g.,
findByEventIdAndTypeOrderByDisplayOrderAscIdAsc or
findByEventIdOrderByDisplayOrderAscIdAsc(Pageable), have it return a
Page<EventProgram> (so DB computes the count) and update EventService to call
that repository method and remove the in-memory filter + paginate usage so
PagedResult is constructed from the Page content and total elements returned by
the DB.
| CREATE TABLE IF NOT EXISTS event | ||
| ( |
There was a problem hiding this comment.
[LEVEL: medium]
문제: 버전드 Flyway 마이그레이션에서 CREATE TABLE IF NOT EXISTS를 사용하면 예상과 다른 기존 스키마가 있어도 마이그레이션이 성공 처리됩니다.
영향: 환경별 스키마 드리프트가 숨겨져 런타임에서 엔티티/쿼리 불일치 오류가 늦게 터질 수 있습니다.
제안: 버전드 마이그레이션에서는 IF NOT EXISTS를 제거해 스키마 불일치를 즉시 실패시키고 필요 시 별도 보정 마이그레이션으로 처리해 주세요, As per coding guidelines, "src/main/resources/db/migration/**/*.sql: ... 운영 영향 관점에서 검토한다."
Also applies to: 15-16
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/main/resources/db/migration/V70__add_event_tables.sql` around lines 1 -
2, Remove the "IF NOT EXISTS" from the versioned Flyway migration CREATE TABLE
statement so the migration fails on schema drift; specifically update the SQL in
V70__add_event_tables.sql by changing "CREATE TABLE IF NOT EXISTS event" to
"CREATE TABLE event" (and remove any other "IF NOT EXISTS" occurrences around
the event table creation referenced at lines 15-16), ensuring any intentional
conditional behavior is handled in a separate repeatable/corrective migration.
| event_id INT NOT NULL, | ||
| type ENUM ('POINT', 'RESONANCE') NOT NULL, | ||
| title VARCHAR(100) NOT NULL, | ||
| description VARCHAR(255) NOT NULL, | ||
| thumbnail_url VARCHAR(255), | ||
| reward_point INT, | ||
| status ENUM ('UPCOMING', 'ONGOING', 'ENDED') NOT NULL, | ||
| display_order INT NOT NULL DEFAULT 0, |
There was a problem hiding this comment.
[LEVEL: medium]
문제: event_program 테이블에 조회 패턴(event_id 필터 + display_order, id 정렬)에 맞는 복합 인덱스가 없습니다.
영향: 데이터가 늘면 filesort/추가 정렬 비용으로 프로그램 목록 API 응답 시간이 급격히 느려질 수 있습니다(재현 조건: 특정 행사 프로그램 대량 적재).
제안: INDEX idx_event_program_event_order (event_id, display_order, id)를 추가해 현재 조회 경로를 커버해 주세요, As per coding guidelines, "보안, 트랜잭션 경계, 예외 처리, N+1, 성능 회귀 가능성을 우선 점검한다."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/main/resources/db/migration/V70__add_event_tables.sql` around lines 18 -
25, Add a composite index to the event_program table to cover the common query
pattern filtering by event_id and ordering by display_order and id: create index
idx_event_program_event_order on event_program(event_id, display_order, id).
Modify the V70__add_event_tables.sql migration to include this INDEX declaration
alongside the event_program table definition (or as a separate CREATE INDEX
statement within the same migration) so that queries using event_id + ORDER BY
display_order, id avoid filesort and scale efficiently.
🔍 개요
🚀 주요 변경 내용
NOT_FOUND_EVENT응답 코드를 함께 복구합니다.💬 참고 사항
checkstyleMain,compileJava를 통과했습니다.✅ Checklist (완료 조건)