diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-04-01 13:44:01 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-04-01 13:44:01 +0200 |
| commit | 7ab6907752203abe1ebed152b6933f0b324abd1b (patch) | |
| tree | fdf0a91774add78affc478669dbbc810dfacd51a | |
| parent | 418e5c253cdbc5d5171b73c221e45a1b551ceaa8 (diff) | |
| download | orm-7ab6907752203abe1ebed152b6933f0b324abd1b.tar.gz orm-7ab6907752203abe1ebed152b6933f0b324abd1b.zip | |
fix player relationships
| -rw-r--r-- | model.js | 7 |
1 files changed, 1 insertions, 6 deletions
@@ -5,7 +5,6 @@ module.exports = (seq, Seq) => { let Match = seq.import("./models/match.js"), Asset = seq.import("./models/asset.js"), Roster = seq.import("./models/roster.js"), - //Team = seq.import("./models/team.js"), Participant = seq.import("./models/participant.js"), ParticipantExt = seq.import("./models/participant_ext.js"), ParticipantItemUse = seq.import("./models/participant_item_use.js"), @@ -16,15 +15,11 @@ module.exports = (seq, Seq) => { Match.hasMany(Asset, {as: "Assets"}); Asset.belongsTo(Match); Roster.belongsTo(Match, { foreignKey: "match_api_id", targetKey: "api_id" }); - //Roster.hasOne(Team, {as: "Team"}); - //Team.belongsTo(Roster); Participant.belongsTo(Roster, { foreignKey: "roster_api_id", targetKey: "api_id" }); - Participant.hasOne(Player, { foreignKey: "player_api_id", targetKey: "api_id" }); + Participant.belongsTo(Player, { foreignKey: "player_api_id", targetKey: "api_id" }); ParticipantItemUse.belongsTo(Participant, { foreignKey: "participant_api_id", targetKey: "api_id" }); ParticipantItemUse.hasOne(Item); - ParticipantExt.belongsTo(Participant, { foreignKey: "participant_api_id", targetKey: "api_id" }); PlayerExt.belongsTo(Player, { foreignKey: "player_api_id", targetKey: "api_id" }); - //return {Match, Roster, Team, Participant, Player, Asset}; return {Match, Roster, Participant, ParticipantExt, ParticipantItemUse, Player, PlayerExt, Asset, Item}; }; |
