You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 15, 2025. It is now read-only.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Tag의 특수성
Tag는 Pick과 User에서 별도의 순서를 보장해야하므로
Pick에서도 TagOrder를 가지고, User에서도 TagOrder를 가져야함
방법 1. 필드에 Order를 직접 가지게 한다.
Tag 엔티티에 order필드 - 사용자가 태그를 추가할때 태그가 보이는 순서(UserTagOrder)
PickTag 엔티티에 order필드 - 픽에 있는 태그들의 순서(PickTagOrder)
장점
단점
ex) 5번째 태그를 2번째로 이동한경우 2,3,4,5번에 있는 모든 태그들의 order를 한칸씩 뒤로 밀리게 해야함(update query 4번 발생)
방법 2. Order를 List로 가지고 db에는 List -> String으로 변환하여 넣는다.
현재 채택하고 있는 방법임..
User는 List tagOrder,
Pick은 List tagOrder 를 각각 가진다.
Tag와 PickTag는 order에 관한 정보를 가지고 있지 않음.
장점
단점
정말로 태그의 순서보장이 필요한가..?
태그 등록시 검색기능이 존재하기 때문에 사실 tagOrder가 없어도 괜찮은게 아닐까? 라는 생각이 드네요
의견 자유롭게 주세요. 지금 당장 로직을 변경할건 아니고 의견이 좀 모이면 리팩토링하려고 합니다.
@dmdgpdi @kimminkyeu @sangwonsheep
Beta Was this translation helpful? Give feedback.
All reactions