Skip to content

feat: 아이템 정보 테이블 PK 변경#65

Merged
dev-ant merged 5 commits into
devfrom
feat/alter-item-info-pk
Oct 18, 2025
Merged

feat: 아이템 정보 테이블 PK 변경#65
dev-ant merged 5 commits into
devfrom
feat/alter-item-info-pk

Conversation

@dev-ant

@dev-ant dev-ant commented Oct 18, 2025

Copy link
Copy Markdown
Contributor

📋 상세 설명

  • 게임 데이터상 아이템명이 유니크하지 않은 것을 확인
    • item_info 테이블의 Primary Key를 단일 키(name)에서 복합 키(name, sub_category, top_category)로 변경
    • Spring Data JPA Repository의 쿼리 메서드를 복합 키 경로로 수정 (findByTopCategory → findByIdTopCategory, findBySubCategory → findByIdSubCategory)
    • 기존의 ItemCategory Enum에서 기타 소모폼이라고 오타가 있어 수정
      • 개발 DB의 데이터는 수동으로 기타 소모품으로 수정

📊 체크리스트

  • PR 제목이 형식에 맞나요 e.g. feat: PR을 등록한다
  • 코드가 테스트 되었나요
  • 문서는 업데이트 되었나요
  • 불필요한 코드를 제거했나요
  • 이슈와 라벨이 등록되었나요

📆 마감일

Close #64

@dev-ant dev-ant requested a review from Copilot October 18, 2025 06:28
@dev-ant dev-ant self-assigned this Oct 18, 2025
@dev-ant dev-ant added the ✨feature 새로운 기능 추가 label Oct 18, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR changes the item_info table's primary key from a single column (name) to a composite key (name, sub_category, top_category) after discovering that item names are not unique in the game data. Additionally, a typo in the ItemCategory enum ("소모폼" → "소모품") was corrected.

Key Changes

  • Introduced ItemInfoId as an embeddable composite primary key class
  • Updated JPA repository query methods to use composite key field paths (findByIdTopCategory, findByIdSubCategory)
  • Fixed typo in ItemCategory enum from "소모폼" to "소모품"

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
ItemInfoId.java New embeddable composite key class containing name, subCategory, and topCategory
ItemInfo.java Replaced individual ID fields with EmbeddedId and added helper methods for backward compatibility
ItemInfoJpaRepository.java Updated generic type parameter and query method names to use composite key paths
ItemInfoRepositoryPortImpl.java Updated method calls to use new query method names
V10__alter_item_info_pk.sql Database migration script to alter primary key constraint
ItemCategory.java Corrected typo in category names from "소모폼" to "소모품"
ItemInfoServiceTest.java Added comprehensive unit tests for ItemInfoService methods

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions

github-actions Bot commented Oct 18, 2025

Copy link
Copy Markdown

✅ 테스트 결과 for PR

Build: success

🧪 테스트 실행 with Gradle
📈 Coverage: -0.00%

📁 테스트 결과
📁 커버리지 보고서 (HTML)

@codecov

codecov Bot commented Oct 18, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.71429% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ucture/persistence/ItemInfoRepositoryPortImpl.java 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@dev-ant dev-ant merged commit 0903f6c into dev Oct 18, 2025
2 checks passed
@dev-ant dev-ant deleted the feat/alter-item-info-pk branch October 18, 2025 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨feature 새로운 기능 추가

Projects

None yet

Development

Successfully merging this pull request may close these issues.

아이템 정보 테이블 PK 변경

2 participants