[Fix] 스키마 설정 일관화(default_schema + search_path) 및 페이지네이션 안정화 - #634 #635
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.
Related issue 🛠
Work Description ✏️
목적
운영 환경에서 발생한 2가지 오류를 해결합니다.
원인: Swagger가
sort=["string"]같은 값을 전달하면서findAllByStampIdOrderByClapCountDescUpdatedAtDesc메서드 해석 과정에잘못된 필드명이 섞여
No property '["string"]' found for type 'Clap'예외 발생.조치:
page,size는 쿼리 파라미터로 받고, 유효성 보정(page≥0, 1≤size) 적용.원인: DB 기본 스키마가
public인 환경에서UPDATE stamp ... RETURNING네이티브 쿼리가원격 db 스키마를 못 찾아 실패.
조치:
StampRepositoryImpl네이티브 SQL에 스키마 접두어({schema}.stamp)를 적용.application.yml에hibernate.default_schema와hikari.connection-init-sql(SET search_path ...)을 설정해JPA/Hibernate와 네이티브가 동일 스키마를 보도록 정합성 확보.
변경사항 요약
StampControllerGET /stamps/{stampId}/clappers에서page,size직접 파라미터 사용, 값 보정 로직 추가.StampRepositoryImpl@Value로 스키마 주입 받아 네이티브 UPDATE에 스키마 접두어 적용.application.ymlspring.datasource.hikari.connection-init-sql로 search_path 설정.ClapMilestoneGuard@Value로 스키마 주입 받아 네이티브 INSERT에 스키마 접두어 적용.Trouble Shooting ⚽️
Related ScreenShot 📷
Uncompleted Tasks 😅
To Reviewers 📢