summaryrefslogtreecommitdiff
path: root/model.js
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-08-21 19:40:03 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2017-08-21 19:40:03 +0200
commitb580deeb6d890e411fd26fc78bef55427e4755c5 (patch)
tree087b4fbf6e874a0f7d4f74d8a5d1f4014722f6a5 /model.js
parent8c806f8bbbc2d4e249b5ad04069a7a9f44fcce1b (diff)
downloadorm-b580deeb6d890e411fd26fc78bef55427e4755c5.tar.gz
orm-b580deeb6d890e411fd26fc78bef55427e4755c5.zip
add more associations for phases
Diffstat (limited to 'model.js')
-rw-r--r--model.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/model.js b/model.js
index b0bb70d..ee29d4c 100644
--- a/model.js
+++ b/model.js
@@ -50,8 +50,11 @@ module.exports = (seq, Seq) => {
Participant.belongsTo(Match, { foreignKey: "match_api_id", targetKey: "api_id" });
Participant.belongsTo(Player, { foreignKey: "player_api_id", targetKey: "api_id" });
Participant.hasMany(ParticipantStats, { foreignKey: "participant_api_id", sourceKey: "api_id" });
+ Participant.hasMany(ParticipantItems, { foreignKey: "participant_api_id", sourceKey: "api_id" });
Participant.hasMany(ParticipantPhases, { foreignKey: "participant_api_id", sourceKey: "api_id" });
ParticipantPhases.belongsTo(Participant, { foreignKey: "participant_api_id", targetKey: "api_id" });
+ ParticipantPhases.hasMany(Hero, { foreignKey: "id", sourceKey: "ban", as: "HeroBan" });
+ ParticipantPhases.hasMany(Hero, { foreignKey: "id", sourceKey: "pick", as: "HeroPick" });
Participant.belongsTo(GameMode, { foreignKey: "game_mode_id" });
Participant.belongsTo(Hero, { foreignKey: "hero_id" });
Participant.belongsTo(Series, { foreignKey: "series_id" });