https://segmentfault.com/a/1190000003987871#articleHeader20
如这个文章所示,当
User.hasMany(Note);
Note.belongsTo(User);
定义好之后,自动 在node表中加入 user_id 的外键,那么我如何定义这个外键的名称呢?
我试过
Note.belongsTo(User,{foreignKey:'aaabbbb'});
是不可以的。
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号