-
Notifications
You must be signed in to change notification settings - Fork 0
feat: 사진 앨범 도메인 추가 #37
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
Conversation
| @ManyToOne(fetch = FetchType.LAZY) | ||
| @JoinColumn(name = "photo_id", nullable = false) | ||
| private Photo photo; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C
앨범 애그리거트에서 사진 애그리거트를 직접 참조하는 것에 대해 어떻게 생각하시나요?
다른 애그리거트는 id 형태로 간접 참조해도 괜찮지 않을까 생각합니다.
| @ManyToOne(fetch = FetchType.LAZY) | ||
| @JoinColumn(name = "album_id", nullable = false) | ||
| private Album album; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C
루트 애그리거트를 Album 이라고 생각하는데 어떤가요?
Album에서 리스트형태로 AlbumPhoto를 관리하고
AlbumPhoto는 Embeddable로 보는 것도 괜찮다고 생각합니다.
더불어 앨범이 삭제될경우 AlbumPhoto도 같이 삭제될 수 있도록 Cascade 설정도 할 필요가 있어 보여요.
| create table if not exists albums_photos | ||
| ( | ||
| id bigint unsigned auto_increment | ||
| primary key, | ||
| album_id bigint, | ||
| photo_id bigint | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C
참조키 제약조건을 걸 수도 있을 것 같은데 어떻게 생각하시나요? 고민이 되는 부분입니다.
📌 ISSUE 번호
📄 작업 내용 요약
🏗️ 앨범 테이블 설계
📦 앨범-사진 관계 도메인
AlbumPhoto정의🕹️ 앨범 CRUD 추가
🔍 지도 사진 조회 API 검색 조건 변경
from)와 끝 날짜(to) 범위 내의 사진을PhotoMarker로 변환albumId에 해당하는 사진을PhotoMarker로 변환📢 참고 사항
✅ 체크리스트