当前位置:网站首页>Sequelize. JS and hasmany - belongsto vs hasmany in serialize js
Sequelize. JS and hasmany - belongsto vs hasmany in serialize js
2022-07-05 04:07:00 【Rich in starch】
problem :
What's the difference between B.belongsTo(A)
and A.hasMany(B)
B.belongsTo(A)
and A.hasMany(B)
What's the difference
Artist = sequelize.define('Artist', {});Album = sequelize.define('Albums', {});Album.belongsTo(Artist, foreignKey: 'album_belongsl_artist');Artist.hasMany(Album, foreignKey: 'artist_hasmany_albums');
if it in both cases creates the depended tables in Album
? If it is in both cases Album
Created dependency table ?
Solution :
Reference resources : https://stackoom.com/en/question/1N8ZD边栏推荐
- Technical tutorial: how to use easydss to push live streaming to qiniu cloud?
- Use Firefox browser to quickly pick up Web image materials
- 优先使用对象组合,而不是类继承
- 网络安全-记录web漏洞修复
- [PHP features - variable coverage] improper use, improper configuration and code logic vulnerability of the function
- 长度为n的入栈顺序的可能出栈顺序
- Judge whether the stack order is reasonable according to the stack order
- Interview summary: This is a comprehensive & detailed Android interview guide
- How is the entered query SQL statement executed?
- mysql的七种join连接查询
猜你喜欢
面试字节,过关斩将直接干到 3 面,结果找了个架构师来吊打我?
A real day for Beijing programmers!!!!!
陇原战“疫“2021网络安全大赛 Web EasyJaba
UI自動化測試從此告別手動下載瀏覽器驅動
C language course setting: cinema ticket selling management system
How does the applet solve the rendering layer network layer error?
我国算力规模排名全球第二:计算正向智算跨越
@Transactional 注解导致跨库查询失效的问题
Behavior perception system
[wp]bmzclub writeup of several questions
随机推荐
Behavior perception system
Why do big companies such as Baidu and Alibaba prefer to spend 25K to recruit fresh students rather than raise wages by 5K to retain old employees?
How does the applet solve the rendering layer network layer error?
Three level linkage demo of uniapp uview u-picker components
The order of LDS links
面试汇总:这是一份全面&详细的Android面试指南
DFS and BFS concepts of trees and graphs
error Couldn‘t find a package. JSON file in "your path“
[charging station]_ Secular wisdom_ Philosophical wisdom _
特殊版:SpreadJS v15.1 VS SpreadJS v15.0
mysql的七种join连接查询
Deep learning - LSTM Foundation
已解决(sqlalchemy+pandas.read_sql)AttributeError: ‘Engine‘ object has no attribute ‘execution_options‘
Why can't all browsers on my computer open web pages
Use object composition in preference to class inheritance
Threejs implements labels and displays labels with custom styles
On the day 25K joined Tencent, I cried
基于TCP的移动端IM即时通讯开发仍然需要心跳保活
Ctfshow web entry code audit
Soul 3: what is interface testing, how to play interface testing, and how to play interface automation testing?