From 4a46de3e1d5c4427753c80d3e9f88df49a1c7539 Mon Sep 17 00:00:00 2001 From: schneefux Date: Fri, 7 Apr 2017 21:34:43 +0200 Subject: link items to participant --- model.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/model.js b/model.js index 541299c..1a06aa1 100644 --- a/model.js +++ b/model.js @@ -21,7 +21,8 @@ module.exports = (seq, Seq) => { Roster.belongsTo(Match, { foreignKey: "match_api_id", targetKey: "api_id" }); Participant.belongsTo(Roster, { foreignKey: "roster_api_id", targetKey: "api_id" }); - //Participant.belongsTo(Heros, { foreignKey: "actor", targetKey: "api_name" }); + Participant.hasMany(ItemParticipant, { as: "items", foreignKey: "participant_api_id", sourceKey: "api_id" }); + ItemParticipant.belongsTo(Item, { foreignKey: "item_id", targetKey: "id" }); return { Match, Roster, Participant, Player, Asset, -- cgit v1.3.1