Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] 불필요한 import 제거 등 코드 정리 (#155) #156

Merged
merged 3 commits into from
Aug 24, 2024

Conversation

win-luck
Copy link
Collaborator

@win-luck win-luck commented Aug 24, 2024

#️⃣ 연관 이슈

📝 작업 내용

프로젝트 공식 종료 전 불필요한 import와 테스트 코드의 public 제어자를 정리했습니다.

또한 추상 테스트 클래스에서 TRUNCATE 이후 AUTO_INCREMENT를 1로 재설정하는 부분을 제거했습니다.

이는 현재 Entity 객체의 PK 관리 전략이 @GeneratedValue(strategy = GenerationType.IDENTIFY)이기에 AUTO_INCREMENT 방식으로 id를 부여하고 있는데, 검토 결과 mySQL에서는 TRUNCATE TABLE 만으로도 AUTO_INCREMENT를 1로 재설정할 수 있기 때문입니다.

단, postgreSQL의 경우엔 TRUNCATE 문을 사용해도 AUTO_INCREMENT가 1로 초기화되지 않는다고 합니다. 다만 그렇다고 해서 기존에 존재하던 ALTER문을 유지함으로써 1로 초기화할 수 있는 건 또 아니어서, DB 자체가 바뀌면 쿼리문 수정은 필연적일 듯 합니다.

참고 이미지 및 자료

How to Reset Auto Increment in MySQL (GeeksForGeeks)
DELETE 와 TRUNCATE의 차이점

💬 리뷰 요구사항

@win-luck win-luck added the chore 개발과 직접적인 관련이 없음 label Aug 24, 2024
@win-luck win-luck requested a review from blaxsior August 24, 2024 06:02
@win-luck win-luck self-assigned this Aug 24, 2024
@win-luck win-luck linked an issue Aug 24, 2024 that may be closed by this pull request
1 task
Copy link
Collaborator

@blaxsior blaxsior left a comment

Choose a reason for hiding this comment

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

필요 없는 import를 제거해주셔서 코드가 좀 더 깔끔해진 것 같습니다.

@win-luck win-luck merged commit 0b27a92 into dev Aug 24, 2024
1 check passed
@win-luck win-luck deleted the feature/155-chore branch August 30, 2024 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore 개발과 직접적인 관련이 없음
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[chore] 불필요한 import 제거 등 코드 정리 (#155)
2 participants