강의

멘토링

커뮤니티

Inflearn Community Q&A

raymondanything's profile image
raymondanything

asked

Learn NestJS by following along

Get only the posts of that user

board 테이블에 userId라는 키값

Written on

·

325

0

board 테이블 안에 userId라는 키값은 어떤 기준으로 생성되는건가요?

typeorm에서 제공하는 컨벤션인가요?

postgresqlNestJSTypeORMjwt

Answer 1

1

typeorm 에서 ManyToOne 을 사용할 때 Many(board)쪽 테이블에 relation 된 테이블(user)의 id 를 foreign key 로 생성해주는 것 같습니다. 이때 userId 로 생성되는 것이고요.
https://orkhan.gitbook.io/typeorm/docs/many-to-one-one-to-many-relations#:~:text=Here%20we%20added,and%20foreign%20key.

raymondanything's profile image
raymondanything

asked

Ask a question