当前位置:网站首页>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边栏推荐
猜你喜欢
ActiveReportsJS 3.1 VS ActiveReportsJS 3.0
Threejs Internet of things, 3D visualization of farms (I)
Pyqt5 displays file names and pictures
Threejs factory model 3DMAX model obj+mtl format, source file download
JWT vulnerability recurrence
线上故障突突突?如何紧急诊断、排查与恢复
[untitled]
Operation flow of UE4 DMX and grandma2 onpc 3.1.2.5
Use Firefox browser to quickly pick up Web image materials
On the day 25K joined Tencent, I cried
随机推荐
网络安全-记录web漏洞修复
Why is there a reincarnation of 60 years instead of 120 years in the tiangan dizhi chronology
我就一写代码的,王总整天和我谈格局...
企业级:Spire.Office for .NET:Platinum|7.7.x
Basic function learning 02
EasyCVR更改录像存储路径,不生成录像文件如何解决?
C language course setting: cinema ticket selling management system
CTF stegano practice stegano 9
Ctfshow web entry code audit
根据入栈顺序判断出栈顺序是否合理
MindFusion. Virtual Keyboard for WPF
Threejs implements labels and displays labels with custom styles
Get to know MySQL connection query for the first time
Summary of scene design
The order of LDS links
如何实现实时音视频聊天功能
Pyqt pyside custom telescopic menu bar sharing (including tutorial)
As soon as I write the code, President Wang talks with me about the pattern all day
[charging station]_ Secular wisdom_ Philosophical wisdom _
已解决(sqlalchemy+pandas.read_sql)AttributeError: ‘Engine‘ object has no attribute ‘execution_options‘