From b580deeb6d890e411fd26fc78bef55427e4755c5 Mon Sep 17 00:00:00 2001 From: schneefux Date: Mon, 21 Aug 2017 19:40:03 +0200 Subject: add more associations for phases --- model.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'model.js') 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" }); -- cgit v1.3.1