summaryrefslogtreecommitdiff
path: root/model.js
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-04-07 21:34:43 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2017-04-07 21:34:43 +0200
commit4a46de3e1d5c4427753c80d3e9f88df49a1c7539 (patch)
tree3de5712d270a8bdab0d12959bc91bea9ebd0bfc0 /model.js
parent4f5f8c552970fef615a8d9e612036c287b03a2c9 (diff)
downloadorm-4a46de3e1d5c4427753c80d3e9f88df49a1c7539.tar.gz
orm-4a46de3e1d5c4427753c80d3e9f88df49a1c7539.zip
link items to participant
Diffstat (limited to 'model.js')
-rw-r--r--model.js3
1 files changed, 2 insertions, 1 deletions
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,