summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-04-06 13:42:58 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2017-04-06 13:42:58 +0200
commit6d9111d80dc2d42072dc6f978583bdefd357ce5e (patch)
tree0c6aa52d9a820b4f11f737e72f2a23974826610e
parent1fd083b95f9ebc5ef01ee554eda43f07d12457e2 (diff)
downloadorm-6d9111d80dc2d42072dc6f978583bdefd357ce5e.tar.gz
orm-6d9111d80dc2d42072dc6f978583bdefd357ce5e.zip
prepare relations and schema for cruncher
-rw-r--r--model.js36
1 files changed, 30 insertions, 6 deletions
diff --git a/model.js b/model.js
index b2a2c17..7f46559 100644
--- a/model.js
+++ b/model.js
@@ -1,19 +1,43 @@
/* jshint esnext:true */
-'use strict';
+"use strict";
module.exports = (seq, Seq) => {
- let Match = seq.import("./models/match.js"),
+ let // core data
+ Match = seq.import("./models/match.js"),
Asset = seq.import("./models/asset.js"),
Roster = seq.import("./models/roster.js"),
Participant = seq.import("./models/participant.js"),
- ParticipantExt = seq.import("./models/participant_ext.js"),
- ItemParticipant = seq.import("./models/item_participant.js"),
Player = seq.import("./models/player.js"),
+
+ // mappings
+ Item = seq.import("./models/item.js"),
+
+ // Telemetry
+ ItemParticipant = seq.import("./models/item_participant.js"),
+
+ // data stats
+ ParticipantExt = seq.import("./models/participant_ext.js"),
PlayerExt = seq.import("./models/player_ext.js"),
- Item = seq.import("./models/item.js");
+
+ // stats mappings
+ StatsDimensions = seq.import("./models/stats_dimensions.js"),
+ Heros = seq.import("./models/heros.js"),
+
+ // hero stats
+ HeroStats = seq.import("./models/hero_stats.js"),
+ HeroDimension = seq.import("./models/hero_dimension.js");
+
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" });
- return {Match, Roster, Participant, ParticipantExt, ItemParticipant, Player, PlayerExt, Asset, Item};
+ return {
+ Match, Roster, Participant, Player, Asset,
+ Item,
+ ItemParticipant,
+ ParticipantExt, PlayerExt,
+ StatsDimensions, Heros,
+ HeroStats, HeroDimension
+ };
};