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

feat: add db schema #23

Closed
wants to merge 1 commit into from
Closed

feat: add db schema #23

wants to merge 1 commit into from

Conversation

JjungminLee
Copy link
Member

@JjungminLee JjungminLee commented Feb 8, 2023

Issue

Resolves #6

Description

DB 스키마 초안 작업을 해봤습니다! 부족한 점이 많아요! 보시고 많이 피드백 해주세요 😀

Check List

  • PR 제목을 커밋 규칙에 맞게 작성
  • 적절한 라벨 설정
  • GitHub Projects에 연결
  • 작업한 사람 모두를 Assign
  • Code Review 요청
  • DB Schema를 바꾼 경우, DB Schema를 바꾸는 다른 PR이 없는지 확인
  • main 브랜치의 최신 상태를 반영하고 있는지 확인

@JjungminLee JjungminLee added the feature 기능 추가/수정 label Feb 8, 2023
@JjungminLee JjungminLee self-assigned this Feb 8, 2023
@vercel
Copy link

vercel bot commented Feb 8, 2023

@JjungminLee is attempting to deploy a commit to the GDSC Soongsil Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@kanghyun98 kanghyun98 left a comment

Choose a reason for hiding this comment

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

🐰 고생 많으셨어요! 이름이랑 속성들 때문에 고민 많으셨겠어요..ㅠㅠ
그리고 제 의견이랑 변경해야할 사항들 리뷰에 남겨놨습니다! 한번씩 읽어보시고 자유롭게 의견 남겨주세요:)
(참고로 중복되는 수정사항은 헷갈리실까봐 다시 안적어놨으니 참고 부탁드릴게요!)

Comment on lines +98 to +101
enum Type {
STUDY
PROJECT
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🥝 음 "활동 종류"를 위한 enum의 네이밍이니깐 ActivityType 같은건 어떤가요?

Copy link
Member Author

Choose a reason for hiding this comment

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

좋아요!

id Int @id @default(autoincrement())
type Type
createdAt DateTime @default(now())
updatedAt DateTime?
Copy link
Contributor

Choose a reason for hiding this comment

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

🍌 updatedAt도 처음에는 createdAt이랑 같은 값을 가지고, 이후에 변경될 때마다 업데이트 되어야하니깐 createdAt과 마찬가지로 NOT NULL 속성을 가져야하는 것으로 알고 있어요!

그리고 매번 직접 업데이트하지 않고 편리하게 사용할 수 있도록 Prisma에서 @updateAt 이라는 속성을 제공해줍니다! (공식 문서)

Suggested change
updatedAt DateTime?
updatedAt DateTime @updatedAt

type Type
createdAt DateTime @default(now())
updatedAt DateTime?
status String @default("ACTIVE")
Copy link
Contributor

Choose a reason for hiding this comment

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

🥝 status도 네이밍을 조금 직관적이게 deleted 같은거는 어떨까요?
그러면 기존의 status라는 이름으로 했을때는 enum으로 값을 관리해야 할 것 같은데 deleted로 하면 boolean형으로 비교적 간단하고 직관적으로 관리할 수 있을 것 같아서요!

만약 기존 네이밍을 유지한다면 위에서 말씀드렸던 것처럼 enum으로 값을 관리해야할 것 같아요!

Copy link
Contributor

Choose a reason for hiding this comment

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

지난번에 정했던 부분이긴 하지만 그때는 생각을 못했어가지구, 생각나서 말씀드립니다!ㅎ

Copy link
Member Author

Choose a reason for hiding this comment

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

status enum으로 관리하는거 좋은 것 같습니다!

Comment on lines +23 to +24
ActivityEnroll ActivityEnroll?
Github Github?
Copy link
Contributor

Choose a reason for hiding this comment

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

🍌 이 친구들 표기법이 PascalCase로 되어있는데 camelCase로 바꿔주는게 맞는 것 같아요!

Copy link
Member Author

Choose a reason for hiding this comment

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

넵 이부분 수정할게요!

Github Github?
}

model ActivityEnroll {
Copy link
Contributor

Choose a reason for hiding this comment

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

🥝 이 테이블이 매핑 테이블임을 직관적으로 이해할 수 있도록 지난번에 정했던 이름인 ActivityMemberMapping이 저는 괜찮다고 생각하는데,, 다른분들 의견도 궁금해요!

profileImgURL String @db.VarChar(300)
githubURL String @db.VarChar(300)
memberEmail String @db.VarChar(300)
refreshToken String @db.VarChar(500)
Copy link
Contributor

Choose a reason for hiding this comment

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

image

🍌 위 이미지에서는 `refresshToken`은 Nullable한 것 같은데 어느쪽이 맞는지는 잘 모르겠어요..!

Copy link
Member Author

Choose a reason for hiding this comment

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

아 이거 null 아닙니다 ㅜㅜ 제가 수정해놓을게요 죄송해요..!

Comment on lines +23 to +24
ActivityEnroll ActivityEnroll?
Github Github?
Copy link
Contributor

Choose a reason for hiding this comment

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

🍎 Activity:ActivityEnroll = 1:n 인 점을 생각해보면, ActivityEnroll[]으로 바꿔줘야 하는 것 같아요!
(Github도 마찬가지입니다!)

Comment on lines +58 to +59
ActivityEnroll ActivityEnroll?
MemberSeasonInfo MemberSeasonInfo?
Copy link
Contributor

Choose a reason for hiding this comment

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

🍎 여기도 1:n 관계인 점을 고려해서 타입 변경해줘야할 것 같습니다!

Comment on lines +92 to +96
enum Role {
LEAD
CORE_MEMBER
MEMBER
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🥝 Role 네이밍을 확장성을 고려해서 MemberRole이나 MemberRoleType으로 변경하는건 어떤가요..?ㅎ

Comment on lines +86 to +90
enum MemberSeasonInfo_memverPart {
WEB_MOBILE
SERVER_CLOUD
AI
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🍌 이름이 너무 길고 오타가 있는데, MemberPart이나 MemberPartType은 어떤가요?

@vercel
Copy link

vercel bot commented Feb 9, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
web ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 9, 2023 at 5:34PM (UTC)

@aube-dev aube-dev added the db DB 구조 변경 label Feb 10, 2023
@JjungminLee JjungminLee closed this by deleting the head repository Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
db DB 구조 변경 feature 기능 추가/수정
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

DB Schema 구성
3 participants