asked
[Renewed] Node.js Textbook - From Basics to Project Practice
Understanding Table Relationships
Written on
·
137
0
Answer 1
계속 시퀄라이즈 씁니다. 테이블 만들고 사용한다는 게 무슨 의미이신가요? 뭘 쓰든 테이블은 만들어야합니다. hasMany belongsTo를 안 하면 join이 안 됩니다.
mysql 쿼리를 작성할떄 join을 쓰면
순수하게 select * from user as a
left join comments as b on a.id = b.commter
등으로 써야하는데 저런식으로 hasMany belongsTo 해주면 include로 자동으로 연결가능하다 이말인건가요??
네 맞습니다.
mysql 쿼리를 작성할떄 join을 쓰면
순수하게 select * from user as a
left join comments as b on a.id = b.commter
등으로 써야하는데 저런식으로 hasMany belongsTo 해주면 include로 자동으로 연결가능하다 이말인건가요??