更新时间:2023-02-02 23:37:16
类似问题:classMethod 被移除https://***.com/a/45473628/6811324
Similar issue: classMethod removed https://***.com/a/45473628/6811324
User.hasOne(Group, {foreignKey: 'userId'}) // userId foreignKey on Group
Users.hasOne(Group); // UserId foreignKey on Group
or
Users.belongsTo(models.Group, {foreignKey: 'groupId'}); // groupId to User