summaryrefslogtreecommitdiff
path: root/model.js
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-03-31 18:54:57 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2017-03-31 18:54:57 +0200
commit1871f2ed519db7e893914dc3420f88a17cb17ddc (patch)
tree2aaee92e8754f84867de243093952265b0a221fe /model.js
parent42b2f23c2270ecd706a0d512e9f17899748ab422 (diff)
downloadprocessor-1871f2ed519db7e893914dc3420f88a17cb17ddc.tar.gz
processor-1871f2ed519db7e893914dc3420f88a17cb17ddc.zip
insert assets, squish concurrency bugs
Diffstat (limited to 'model.js')
-rw-r--r--model.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/model.js b/model.js
index 0ff813e..867643b 100644
--- a/model.js
+++ b/model.js
@@ -5,18 +5,24 @@ var JsonField = require("sequelize-json");
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"),
- Player = seq.import("./models/player.js");
+ ParticipantItemUse = seq.import("./models/participant_item_use.js"),
+ Player = seq.import("./models/player.js"),
+ Item = seq.import("./models/item.js");
- //Match.hasMany(Asset, {as: "Assets"});
- //Asset.belongsTo(Match);
+ 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" });
+ ParticipantItemUse.belongsTo(Participant, { foreignKey: "participant_api_id", targetKey: "api_id" });
+ ParticipantItemUse.hasOne(Item);
//return {Match, Roster, Team, Participant, Player, Asset};
- return {Match, Roster, Participant, Player};
+ return {Match, Roster, Participant, ParticipantItemUse, Player, Asset, Item};
};