我需要在名为DataSurvey的模型中添加两个外键,这些外键指向另一个名为AppPerson的模型
DataSurvey.associate = function(models) {
DataSurvey.belongsTo(models.AppPerson); // this should have the name idResponsible
DataSurvey.belongsTo(models.AppPerson); // this should have the name idConcerned };
我该怎么做?
感谢您的帮助
答案 0 :(得分:0)
这很好用
DataSurvey.belongsTo(models.AppPerson, {as: 'Responsible'});
DataSurvey.belongsTo(models.AppPerson, {as: 'Concerned'});