-
Notifications
You must be signed in to change notification settings - Fork 1
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
Refactor/switch database from postgreSQL to MongoDB #105
Conversation
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.
시퀄라이즈 잘가고 .. 성용이 고생했고 .. 고맙고 .. 응 ...
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.
주말간 굉장히 고생하셨슴돠
코드에 질문 2개 달았어요 👍
src/interface/IBook.ts
Outdated
export interface IBook { | ||
_id: mongoose.Schema.Types.ObjectId; | ||
isbn: Number; | ||
isbn_sub: Number; |
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.
- not null이 아닌 칼럼에 ? 붙인다고 했던 것 같음!! (여기 아닌가..)
- O2 코드랑 다른게 여기는 대문자 Number고 O2는 소문자 number인데 차이가 있는건지 궁금해요
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.
- 스키마에 사용되는 인터페이스이기 때문에 여기선 ? 를 사용하지 않습니다! 추후에 DTO를 선언할때는 필요해요!
- 몽고디비는 Number 대문자 데이터 형식을 사용하기 때문에 스키마 선언시에는 Number로, 그 외에 DTO나 interface에서는 타입스크립트에 맞춰 number를 사용하는게 맞습니다, 이 코드에서는 제가 전부 Number를 쓰는 실수를 범했네요! 수정하겠습니다
src/models/User.ts
Outdated
required: false, | ||
}, | ||
// 이메일 인증번호 | ||
emailCode: { |
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.
emailCode
-> email_code
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.
진짜 곰곰하다 동근아 리스펙 ,,
✅ PR check list
🌈 PR 요약
postgreSQL 과 시퀄라이즈 제거
mongoDB, mongoCompass 설치
📌 변경 사항
테스팅을 위해 라우팅 부분을 주석하였습니다.
추가 설치 모듈
npm install mongoose
npm install mongoose-validator
npm install @types/mongoose
Linked Issue
close #102