summaryrefslogtreecommitdiff
path: root/models
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-04-07 17:55:03 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2017-04-07 17:55:03 +0200
commitd4380da66020f2a3d496715d14b637a868c81614 (patch)
treec2d20f90139c7fbb10c1855b3e79e4d525c9a992 /models
parent3493a5bff6d622ccb8f1eba1c72bd939a418c1c5 (diff)
downloadorm-d4380da66020f2a3d496715d14b637a868c81614.tar.gz
orm-d4380da66020f2a3d496715d14b637a868c81614.zip
reimport after breaking changes
Diffstat (limited to 'models')
-rw-r--r--models/asset.js30
-rw-r--r--models/filter.js (renamed from models/stats_dimensions.js)15
-rw-r--r--models/game_mode.js22
-rw-r--r--models/global_point.js (renamed from models/hero_stats.js)36
-rw-r--r--models/hero.js (renamed from models/heros.js)4
-rw-r--r--models/hero_dimension.js33
-rw-r--r--models/item_participant.js8
-rw-r--r--models/match.js25
-rw-r--r--models/match_ext.js52
-rw-r--r--models/participant.js71
-rw-r--r--models/participant_ext.js38
-rw-r--r--models/participant_stats.js173
-rw-r--r--models/player.js10
-rw-r--r--models/player_dimension.js33
-rw-r--r--models/player_ext.js74
-rw-r--r--models/player_point.js214
-rw-r--r--models/region.js (renamed from models/roster_ext.js)6
-rw-r--r--models/role.js21
-rw-r--r--models/roster.js20
-rw-r--r--models/series.js (renamed from models/player_stats.js)20
20 files changed, 559 insertions, 346 deletions
diff --git a/models/asset.js b/models/asset.js
index 71bacab..291dfb7 100644
--- a/models/asset.js
+++ b/models/asset.js
@@ -8,37 +8,43 @@ module.exports = function(sequelize, DataTypes) {
primaryKey: true,
autoIncrement: true
},
- match_api_id: {
- type: DataTypes.STRING(191),
+ api_id: {
+ type: DataTypes.CHAR(36),
+ allowNull: false,
+ unique: true
+ },
+ shard_id: {
+ type: DataTypes.STRING(5),
allowNull: false
},
- api_id: {
- type: DataTypes.STRING(191),
+ match_api_id: {
+ type: DataTypes.CHAR(36),
allowNull: false
},
name: {
- type: DataTypes.STRING(191),
+ type: DataTypes.STRING(16),
allowNull: false
},
url: {
type: DataTypes.STRING(191),
- allowNull: true
+ allowNull: false
},
content_type: {
- type: DataTypes.STRING(191),
- allowNull: true
+ type: DataTypes.STRING(32),
+ allowNull: false
},
created_at: {
type: DataTypes.TIME,
- allowNull: false
+ allowNull: false,
+ defaultValue: sequelize.fn('NOW')
},
description: {
type: DataTypes.STRING(191),
- allowNull: true
+ allowNull: false
},
filename: {
- type: DataTypes.STRING(191),
- allowNull: true
+ type: DataTypes.STRING(32),
+ allowNull: false
}
}, {
tableName: 'asset',
diff --git a/models/stats_dimensions.js b/models/filter.js
index 8b22e58..4ba3966 100644
--- a/models/stats_dimensions.js
+++ b/models/filter.js
@@ -1,26 +1,27 @@
/* jshint indent: 2 */
-var JsonField = require("sequelize-json");
-
module.exports = function(sequelize, DataTypes) {
- return sequelize.define('stats_dimensions', {
+ return sequelize.define('filter', {
id: {
type: DataTypes.INTEGER(10).UNSIGNED,
allowNull: false,
primaryKey: true,
autoIncrement: true
},
- dimension_on: {
+ filter_on: {
type: DataTypes.STRING(191),
allowNull: false
},
- filter_hash: {
+ filter: {
type: DataTypes.STRING(191),
allowNull: false
},
- filter: JsonField(sequelize, "stats_dimensions", "filter")
+ filter_hash: {
+ type: DataTypes.STRING(191),
+ allowNull: false
+ }
}, {
- tableName: 'stats_dimensions',
+ tableName: 'filter',
timestamps: false,
underscored: true,
freezeTableName: true
diff --git a/models/game_mode.js b/models/game_mode.js
new file mode 100644
index 0000000..5eb1a91
--- /dev/null
+++ b/models/game_mode.js
@@ -0,0 +1,22 @@
+/* jshint indent: 2 */
+
+module.exports = function(sequelize, DataTypes) {
+ return sequelize.define('game_mode', {
+ id: {
+ type: DataTypes.INTEGER(10).UNSIGNED,
+ allowNull: false,
+ primaryKey: true,
+ autoIncrement: true
+ },
+ name: {
+ type: DataTypes.STRING(16),
+ allowNull: false,
+ unique: true
+ }
+ }, {
+ tableName: 'game_mode',
+ timestamps: false,
+ underscored: true,
+ freezeTableName: true
+ });
+};
diff --git a/models/hero_stats.js b/models/global_point.js
index c79ea4f..afe9b45 100644
--- a/models/hero_stats.js
+++ b/models/global_point.js
@@ -1,20 +1,16 @@
/* jshint indent: 2 */
module.exports = function(sequelize, DataTypes) {
- return sequelize.define('hero_stats', {
+ return sequelize.define('global_point', {
id: {
type: DataTypes.INTEGER(10).UNSIGNED,
allowNull: false,
primaryKey: true,
autoIncrement: true
},
- created_at: {
- type: DataTypes.TIME,
- allowNull: true
- },
updated_at: {
- type: DataTypes.TIME,
- allowNull: true
+ type: DataTypes.DATE,
+ allowNull: false
},
pick_rate: {
type: "DOUBLE(8,2)",
@@ -31,9 +27,33 @@ module.exports = function(sequelize, DataTypes) {
cs_per_min: {
type: "DOUBLE(8,2)",
allowNull: false
+ },
+ series_id: {
+ type: DataTypes.INTEGER(11),
+ allowNull: false
+ },
+ filter_id: {
+ type: DataTypes.INTEGER(11),
+ allowNull: false
+ },
+ hero_id: {
+ type: DataTypes.INTEGER(11),
+ allowNull: false
+ },
+ game_mode_id: {
+ type: DataTypes.INTEGER(11),
+ allowNull: false
+ },
+ skill_tier_id: {
+ type: DataTypes.INTEGER(11),
+ allowNull: false
+ },
+ build_id: {
+ type: DataTypes.INTEGER(11),
+ allowNull: false
}
}, {
- tableName: 'hero_stats',
+ tableName: 'global_point',
timestamps: false,
underscored: true,
freezeTableName: true
diff --git a/models/heros.js b/models/hero.js
index 5260ee7..167e996 100644
--- a/models/heros.js
+++ b/models/hero.js
@@ -1,7 +1,7 @@
/* jshint indent: 2 */
module.exports = function(sequelize, DataTypes) {
- return sequelize.define('heros', {
+ return sequelize.define('hero', {
id: {
type: DataTypes.INTEGER(10).UNSIGNED,
allowNull: false,
@@ -77,7 +77,7 @@ module.exports = function(sequelize, DataTypes) {
allowNull: false
}
}, {
- tableName: 'heros',
+ tableName: 'hero',
timestamps: false,
underscored: true,
freezeTableName: true
diff --git a/models/hero_dimension.js b/models/hero_dimension.js
deleted file mode 100644
index c5af060..0000000
--- a/models/hero_dimension.js
+++ /dev/null
@@ -1,33 +0,0 @@
-/* jshint indent: 2 */
-
-module.exports = function(sequelize, DataTypes) {
- return sequelize.define('hero_dimension', {
- id: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: false,
- primaryKey: true,
- autoIncrement: true
- },
- hero_id: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- dimension_id: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- stats_id: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- computed_on: {
- type: DataTypes.DATE,
- allowNull: false
- }
- }, {
- tableName: 'hero_dimension',
- timestamps: false,
- underscored: true,
- freezeTableName: true
- });
-};
diff --git a/models/item_participant.js b/models/item_participant.js
index 92584f4..0a5f866 100644
--- a/models/item_participant.js
+++ b/models/item_participant.js
@@ -8,8 +8,8 @@ module.exports = function(sequelize, DataTypes) {
primaryKey: true,
autoIncrement: true
},
- participant_api_id: {
- type: DataTypes.STRING(191),
+ participant_stats_id: {
+ type: DataTypes.CHAR(36),
allowNull: false
},
item_id: {
@@ -17,11 +17,11 @@ module.exports = function(sequelize, DataTypes) {
allowNull: false
},
action: {
- type: DataTypes.STRING(191),
+ type: DataTypes.ENUM('grant','sell','use','final'),
allowNull: false
},
time_from_start: {
- type: DataTypes.INTEGER(11),
+ type: DataTypes.INTEGER(5).UNSIGNED,
allowNull: true
}
}, {
diff --git a/models/match.js b/models/match.js
index ec5bdab..d17d769 100644
--- a/models/match.js
+++ b/models/match.js
@@ -8,37 +8,34 @@ module.exports = function(sequelize, DataTypes) {
primaryKey: true,
autoIncrement: true
},
- api_id: {
- type: DataTypes.STRING(191),
- allowNull: false,
- unique: true
- },
shard_id: {
- type: DataTypes.STRING(191),
+ type: DataTypes.STRING(5),
allowNull: false
},
- series: {
- type: DataTypes.STRING(191),
- allowNull: true
+ api_id: {
+ type: DataTypes.CHAR(36),
+ allowNull: false,
+ unique: true
},
created_at: {
type: DataTypes.TIME,
- allowNull: false
+ allowNull: false,
+ defaultValue: sequelize.fn('NOW')
},
duration: {
- type: DataTypes.INTEGER(11),
+ type: DataTypes.INTEGER(5).UNSIGNED,
allowNull: false
},
game_mode: {
- type: DataTypes.STRING(191),
+ type: DataTypes.STRING(16),
allowNull: false
},
end_game_reason: {
- type: DataTypes.STRING(191),
+ type: DataTypes.STRING(16),
allowNull: false
},
queue: {
- type: DataTypes.STRING(191),
+ type: DataTypes.STRING(16),
allowNull: false
}
}, {
diff --git a/models/match_ext.js b/models/match_ext.js
deleted file mode 100644
index 01d6f6a..0000000
--- a/models/match_ext.js
+++ /dev/null
@@ -1,52 +0,0 @@
-/* jshint indent: 2 */
-
-module.exports = function(sequelize, DataTypes) {
- return sequelize.define('match_ext', {
- id: {
- type: DataTypes.STRING(191),
- allowNull: false
- },
- match_api_id: {
- type: DataTypes.STRING(191),
- allowNull: false,
- unique: true
- },
- winning_side: {
- type: DataTypes.STRING(191),
- allowNull: true
- },
- total_kills: {
- type: DataTypes.INTEGER(11),
- allowNull: true
- },
- kraken_captures: {
- type: DataTypes.INTEGER(11),
- allowNull: true
- },
- gold: {
- type: DataTypes.INTEGER(11),
- allowNull: true
- },
- aces_earned: {
- type: DataTypes.INTEGER(11),
- allowNull: true
- },
- turret_captures: {
- type: DataTypes.INTEGER(11),
- allowNull: true
- },
- gold_mine_captures: {
- type: DataTypes.INTEGER(11),
- allowNull: true
- },
- crystal_miner_captures: {
- type: DataTypes.INTEGER(11),
- allowNull: true
- }
- }, {
- tableName: 'match_ext',
- timestamps: false,
- underscored: true,
- freezeTableName: true
- });
-};
diff --git a/models/participant.js b/models/participant.js
index 5779585..050d1af 100644
--- a/models/participant.js
+++ b/models/participant.js
@@ -9,104 +9,101 @@ module.exports = function(sequelize, DataTypes) {
autoIncrement: true
},
shard_id: {
- type: DataTypes.STRING(191),
+ type: DataTypes.STRING(5),
allowNull: false
},
api_id: {
- type: DataTypes.STRING(191),
+ type: DataTypes.CHAR(36),
allowNull: false,
unique: true
},
player_api_id: {
- type: DataTypes.STRING(191),
+ type: DataTypes.CHAR(36),
allowNull: false
},
roster_api_id: {
- type: DataTypes.STRING(191),
+ type: DataTypes.CHAR(36),
allowNull: false
},
hero_id: {
- type: DataTypes.STRING(191),
+ type: DataTypes.INTEGER(10).UNSIGNED,
allowNull: false
},
created_at: {
type: DataTypes.TIME,
- allowNull: true
- },
- series: {
- type: DataTypes.TIME,
- allowNull: true
+ allowNull: false,
+ defaultValue: sequelize.fn('NOW')
},
actor: {
- type: DataTypes.STRING(191),
+ type: DataTypes.STRING(16),
allowNull: false
},
- assists: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- crystal_mine_captures: {
- type: DataTypes.INTEGER(11),
+ kills: {
+ type: DataTypes.INTEGER(5).UNSIGNED,
allowNull: false
},
deaths: {
- type: DataTypes.INTEGER(11),
+ type: DataTypes.INTEGER(5).UNSIGNED,
allowNull: false
},
- farm: {
- type: "DOUBLE",
+ assists: {
+ type: DataTypes.INTEGER(5).UNSIGNED,
allowNull: false
},
- first_afk_time: {
- type: "DOUBLE",
+ farm: {
+ type: "DOUBLE(6,2)",
allowNull: false
},
gold: {
- type: DataTypes.INTEGER(11),
+ type: DataTypes.INTEGER(8).UNSIGNED,
allowNull: true
},
+ crystal_mine_captures: {
+ type: DataTypes.INTEGER(5).UNSIGNED,
+ allowNull: false
+ },
+ first_afk_time: {
+ type: "DOUBLE(12,4)",
+ allowNull: false
+ },
gold_mine_captures: {
- type: DataTypes.INTEGER(11),
+ type: DataTypes.INTEGER(5).UNSIGNED,
allowNull: false
},
jungle_kills: {
- type: DataTypes.INTEGER(11),
+ type: DataTypes.INTEGER(5).UNSIGNED,
allowNull: false
},
karma_level: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- kills: {
- type: DataTypes.INTEGER(11),
+ type: DataTypes.INTEGER(3).UNSIGNED,
allowNull: false
},
kraken_captures: {
- type: DataTypes.INTEGER(11),
+ type: DataTypes.INTEGER(5).UNSIGNED,
allowNull: false
},
level: {
- type: DataTypes.INTEGER(11),
+ type: DataTypes.INTEGER(3).UNSIGNED,
allowNull: false
},
minion_kills: {
- type: DataTypes.INTEGER(11),
+ type: DataTypes.INTEGER(5).UNSIGNED,
allowNull: false
},
non_jungle_minion_kills: {
- type: DataTypes.INTEGER(11),
+ type: DataTypes.INTEGER(5).UNSIGNED,
allowNull: false
},
skill_tier: {
- type: DataTypes.INTEGER(11),
+ type: DataTypes.INTEGER(5).UNSIGNED,
allowNull: false
},
skin_key: {
- type: DataTypes.STRING(191),
+ type: DataTypes.STRING(40),
allowNull: false
},
turret_captures: {
- type: DataTypes.INTEGER(11),
+ type: DataTypes.INTEGER(5).UNSIGNED,
allowNull: false
},
went_afk: {
diff --git a/models/participant_ext.js b/models/participant_ext.js
deleted file mode 100644
index 6622359..0000000
--- a/models/participant_ext.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/* jshint indent: 2 */
-
-module.exports = function(sequelize, DataTypes) {
- return sequelize.define('participant_ext', {
- id: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: false,
- primaryKey: true,
- autoIncrement: true
- },
- participant_api_id: {
- type: DataTypes.STRING(191),
- allowNull: false,
- unique: true
- },
- role: {
- type: DataTypes.STRING(191),
- allowNull: true
- },
- score: {
- type: "DOUBLE(8,2)",
- allowNull: true
- },
- kda: {
- type: "DOUBLE(8,2)",
- allowNull: true
- },
- kills_participation: {
- type: "DOUBLE(8,2)",
- allowNull: true
- }
- }, {
- tableName: 'participant_ext',
- timestamps: false,
- underscored: true,
- freezeTableName: true
- });
-};
diff --git a/models/participant_stats.js b/models/participant_stats.js
new file mode 100644
index 0000000..f8c18c0
--- /dev/null
+++ b/models/participant_stats.js
@@ -0,0 +1,173 @@
+/* jshint indent: 2 */
+
+module.exports = function(sequelize, DataTypes) {
+ return sequelize.define('participant_stats', {
+ id: {
+ type: DataTypes.INTEGER(10).UNSIGNED,
+ allowNull: false,
+ primaryKey: true,
+ autoIncrement: true
+ },
+ created_at: {
+ type: DataTypes.TIME,
+ allowNull: true
+ },
+ updated_at: {
+ type: DataTypes.TIME,
+ allowNull: true
+ },
+ participant_id: {
+ type: DataTypes.BIGINT,
+ allowNull: false
+ },
+ kills: {
+ type: DataTypes.INTEGER(5).UNSIGNED,
+ allowNull: false
+ },
+ deaths: {
+ type: DataTypes.INTEGER(5).UNSIGNED,
+ allowNull: false
+ },
+ assists: {
+ type: DataTypes.INTEGER(5).UNSIGNED,
+ allowNull: false
+ },
+ minion_kills: {
+ type: DataTypes.INTEGER(5).UNSIGNED,
+ allowNull: false
+ },
+ jungle_kills: {
+ type: DataTypes.INTEGER(5).UNSIGNED,
+ allowNull: false
+ },
+ non_jungle_minion_kills: {
+ type: DataTypes.INTEGER(5).UNSIGNED,
+ allowNull: false
+ },
+ crystal_mine_captures: {
+ type: DataTypes.INTEGER(5).UNSIGNED,
+ allowNull: false
+ },
+ gold_mine_captures: {
+ type: DataTypes.INTEGER(5).UNSIGNED,
+ allowNull: false
+ },
+ kraken_captures: {
+ type: DataTypes.INTEGER(5).UNSIGNED,
+ allowNull: false
+ },
+ turret_captures: {
+ type: DataTypes.INTEGER(5).UNSIGNED,
+ allowNull: false
+ },
+ gold: {
+ type: DataTypes.INTEGER(8).UNSIGNED,
+ allowNull: true
+ },
+ hero_level: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ role: {
+ type: DataTypes.ENUM('captain','carry','jungler'),
+ allowNull: true
+ },
+ kda_ratio: {
+ type: "DOUBLE(5,5)",
+ allowNull: true
+ },
+ kill_participation: {
+ type: "DOUBLE(5,5)",
+ allowNull: true
+ },
+ cs_per_min: {
+ type: "DOUBLE(7,5)",
+ allowNull: true
+ },
+ kills_per_min: {
+ type: "DOUBLE(6,5)",
+ allowNull: true
+ },
+ impact_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ objective_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ damage_cp_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ damage_wp_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ sustain_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ farm_lane_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ kill_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ objective_lane_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ farm_jungle_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ peal_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ kill_assist_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ objective_jungle_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ vision_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ heal_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ assist_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ utility_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ synergy_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ build_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ offmeta_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ }
+ }, {
+ tableName: 'participant_stats',
+ timestamps: false,
+ underscored: true,
+ freezeTableName: true
+ });
+};
diff --git a/models/player.js b/models/player.js
index 827e9fc..f9eff10 100644
--- a/models/player.js
+++ b/models/player.js
@@ -9,18 +9,14 @@ module.exports = function(sequelize, DataTypes) {
autoIncrement: true
},
shard_id: {
- type: DataTypes.STRING(191),
- allowNull: true
+ type: DataTypes.STRING(5),
+ allowNull: false
},
api_id: {
- type: DataTypes.STRING(191),
+ type: DataTypes.CHAR(36),
allowNull: false,
unique: true
},
- created_at: {
- type: DataTypes.TIME,
- allowNull: true
- },
name: {
type: DataTypes.STRING(191),
allowNull: false
diff --git a/models/player_dimension.js b/models/player_dimension.js
deleted file mode 100644
index 82ff7a0..0000000
--- a/models/player_dimension.js
+++ /dev/null
@@ -1,33 +0,0 @@
-/* jshint indent: 2 */
-
-module.exports = function(sequelize, DataTypes) {
- return sequelize.define('player_dimension', {
- id: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: false,
- primaryKey: true,
- autoIncrement: true
- },
- player_id: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- dimension_id: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- stats_id: {
- type: DataTypes.INTEGER(11),
- allowNull: false
- },
- computed_on: {
- type: DataTypes.DATE,
- allowNull: false
- }
- }, {
- tableName: 'player_dimension',
- timestamps: false,
- underscored: true,
- freezeTableName: true
- });
-};
diff --git a/models/player_ext.js b/models/player_ext.js
deleted file mode 100644
index 55c56ab..0000000
--- a/models/player_ext.js
+++ /dev/null
@@ -1,74 +0,0 @@
-/* jshint indent: 2 */
-
-module.exports = function(sequelize, DataTypes) {
- return sequelize.define('player_ext', {
- id: {
- type: DataTypes.INTEGER(10).UNSIGNED,
- allowNull: false,
- primaryKey: true,
- autoIncrement: true
- },
- player_api_id: {
- type: DataTypes.STRING(191),
- allowNull: false,
- unique: true
- },
- played: {
- type: DataTypes.INTEGER(11),
- allowNull: true
- },
- played_ranked: {
- type: DataTypes.INTEGER(11),
- allowNull: true
- },
- played_casual: {
- type: DataTypes.INTEGER(11),
- allowNull: true
- },
- played_brawl: {
- type: DataTypes.INTEGER(11),
- allowNull: true
- },
- wins: {
- type: DataTypes.INTEGER(11),
- allowNull: true
- },
- wins_ranked: {
- type: DataTypes.INTEGER(11),
- allowNull: true
- },
- wins_casual: {
- type: DataTypes.INTEGER(11),
- allowNull: true
- },
- wins_brawl: {
- type: DataTypes.INTEGER(11),
- allowNull: true
- },
- skill_tier: {
- type: DataTypes.STRING(191),
- allowNull: true
- },
- played_role_1: {
- type: DataTypes.STRING(191),
- allowNull: true
- },
- played_role_2: {
- type: DataTypes.STRING(191),
- allowNull: true
- },
- played_role_3: {
- type: DataTypes.STRING(191),
- allowNull: true
- },
- streak: {
- type: DataTypes.STRING(191),
- allowNull: true
- }
- }, {
- tableName: 'player_ext',
- timestamps: false,
- underscored: true,
- freezeTableName: true
- });
-};
diff --git a/models/player_point.js b/models/player_point.js
new file mode 100644
index 0000000..4304c07
--- /dev/null
+++ b/models/player_point.js
@@ -0,0 +1,214 @@
+/* jshint indent: 2 */
+
+module.exports = function(sequelize, DataTypes) {
+ return sequelize.define('player_point', {
+ id: {
+ type: DataTypes.INTEGER(10).UNSIGNED,
+ allowNull: false,
+ primaryKey: true,
+ autoIncrement: true
+ },
+ shard_id: {
+ type: DataTypes.STRING(5),
+ allowNull: false
+ },
+ player_id: {
+ type: DataTypes.BIGINT,
+ allowNull: false
+ },
+ pick_rate: {
+ type: "DOUBLE(8,2)",
+ allowNull: false
+ },
+ played: {
+ type: DataTypes.INTEGER(11),
+ allowNull: false
+ },
+ wins: {
+ type: DataTypes.INTEGER(11),
+ allowNull: false
+ },
+ time_spent: {
+ type: DataTypes.INTEGER(11),
+ allowNull: false
+ },
+ win_rate: {
+ type: "DOUBLE(8,2)",
+ allowNull: false
+ },
+ series_id: {
+ type: DataTypes.BIGINT,
+ allowNull: false
+ },
+ filter_id: {
+ type: DataTypes.BIGINT,
+ allowNull: false
+ },
+ actor_id: {
+ type: DataTypes.BIGINT,
+ allowNull: false
+ },
+ game_mode_id: {
+ type: DataTypes.BIGINT,
+ allowNull: false
+ },
+ updated_at: {
+ type: DataTypes.DATE,
+ allowNull: false
+ },
+ created_at: {
+ type: DataTypes.TIME,
+ allowNull: false,
+ defaultValue: sequelize.fn('NOW')
+ },
+ kills: {
+ type: DataTypes.INTEGER(5).UNSIGNED,
+ allowNull: false
+ },
+ deaths: {
+ type: DataTypes.INTEGER(5).UNSIGNED,
+ allowNull: false
+ },
+ assists: {
+ type: DataTypes.INTEGER(5).UNSIGNED,
+ allowNull: false
+ },
+ minion_kills: {
+ type: DataTypes.INTEGER(5).UNSIGNED,
+ allowNull: false
+ },
+ jungle_kills: {
+ type: DataTypes.INTEGER(5).UNSIGNED,
+ allowNull: false
+ },
+ non_jungle_minion_kills: {
+ type: DataTypes.INTEGER(5).UNSIGNED,
+ allowNull: false
+ },
+ crystal_mine_captures: {
+ type: DataTypes.INTEGER(5).UNSIGNED,
+ allowNull: false
+ },
+ gold_mine_captures: {
+ type: DataTypes.INTEGER(5).UNSIGNED,
+ allowNull: false
+ },
+ kraken_captures: {
+ type: DataTypes.INTEGER(5).UNSIGNED,
+ allowNull: false
+ },
+ turret_captures: {
+ type: DataTypes.INTEGER(5).UNSIGNED,
+ allowNull: false
+ },
+ gold: {
+ type: DataTypes.INTEGER(8).UNSIGNED,
+ allowNull: true
+ },
+ hero_level: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ role: {
+ type: DataTypes.ENUM('captain','carry','jungler'),
+ allowNull: true
+ },
+ kda_ratio: {
+ type: "DOUBLE(5,5)",
+ allowNull: true
+ },
+ kill_participation: {
+ type: "DOUBLE(5,5)",
+ allowNull: true
+ },
+ cs_per_min: {
+ type: "DOUBLE(7,5)",
+ allowNull: true
+ },
+ kills_per_min: {
+ type: "DOUBLE(6,5)",
+ allowNull: true
+ },
+ impact_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ objective_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ damage_cp_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ damage_wp_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ sustain_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ farm_lane_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ kill_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ objective_lane_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ farm_jungle_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ peal_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ kill_assist_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ objective_jungle_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ vision_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ heal_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ assist_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ utility_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ synergy_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ build_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ },
+ offmeta_score: {
+ type: DataTypes.INTEGER(3).UNSIGNED,
+ allowNull: true
+ }
+ }, {
+ tableName: 'player_point',
+ timestamps: false,
+ underscored: true,
+ freezeTableName: true
+ });
+};
diff --git a/models/roster_ext.js b/models/region.js
index 4a3098b..dd2dd23 100644
--- a/models/roster_ext.js
+++ b/models/region.js
@@ -1,19 +1,19 @@
/* jshint indent: 2 */
module.exports = function(sequelize, DataTypes) {
- return sequelize.define('roster_ext', {
+ return sequelize.define('region', {
id: {
type: DataTypes.INTEGER(10).UNSIGNED,
allowNull: false,
primaryKey: true,
autoIncrement: true
},
- roster_api_id: {
+ name: {
type: DataTypes.STRING(191),
allowNull: false
}
}, {
- tableName: 'roster_ext',
+ tableName: 'region',
timestamps: false,
underscored: true,
freezeTableName: true
diff --git a/models/role.js b/models/role.js
new file mode 100644
index 0000000..a155561
--- /dev/null
+++ b/models/role.js
@@ -0,0 +1,21 @@
+/* jshint indent: 2 */
+
+module.exports = function(sequelize, DataTypes) {
+ return sequelize.define('role', {
+ id: {
+ type: DataTypes.INTEGER(10).UNSIGNED,
+ allowNull: false,
+ primaryKey: true,
+ autoIncrement: true
+ },
+ name: {
+ type: DataTypes.STRING(191),
+ allowNull: false
+ }
+ }, {
+ tableName: 'role',
+ timestamps: false,
+ underscored: true,
+ freezeTableName: true
+ });
+};
diff --git a/models/roster.js b/models/roster.js
index 3848c6a..286726e 100644
--- a/models/roster.js
+++ b/models/roster.js
@@ -9,44 +9,44 @@ module.exports = function(sequelize, DataTypes) {
autoIncrement: true
},
shard_id: {
- type: DataTypes.STRING(191),
+ type: DataTypes.STRING(5),
allowNull: false
},
api_id: {
- type: DataTypes.STRING(191),
+ type: DataTypes.CHAR(36),
allowNull: false,
unique: true
},
match_api_id: {
- type: DataTypes.STRING(191),
+ type: DataTypes.CHAR(36),
allowNull: false
},
aces_earned: {
- type: DataTypes.INTEGER(11),
+ type: DataTypes.INTEGER(5).UNSIGNED,
allowNull: false
},
gold: {
- type: DataTypes.INTEGER(11),
+ type: DataTypes.INTEGER(8).UNSIGNED,
allowNull: false
},
hero_kills: {
- type: DataTypes.INTEGER(11),
+ type: DataTypes.INTEGER(5).UNSIGNED,
allowNull: false
},
kraken_captures: {
- type: DataTypes.INTEGER(11),
+ type: DataTypes.INTEGER(5).UNSIGNED,
allowNull: false
},
side: {
- type: DataTypes.STRING(191),
+ type: DataTypes.STRING(16),
allowNull: false
},
turret_kills: {
- type: DataTypes.INTEGER(11),
+ type: DataTypes.INTEGER(5).UNSIGNED,
allowNull: false
},
turrets_remaining: {
- type: DataTypes.INTEGER(11),
+ type: DataTypes.INTEGER(5).UNSIGNED,
allowNull: false
}
}, {
diff --git a/models/player_stats.js b/models/series.js
index 6bbeb69..c5be4b9 100644
--- a/models/player_stats.js
+++ b/models/series.js
@@ -1,31 +1,27 @@
/* jshint indent: 2 */
module.exports = function(sequelize, DataTypes) {
- return sequelize.define('player_stats', {
+ return sequelize.define('series', {
id: {
type: DataTypes.INTEGER(10).UNSIGNED,
allowNull: false,
primaryKey: true,
autoIncrement: true
},
- created_at: {
+ name: {
+ type: DataTypes.STRING(191),
+ allowNull: false
+ },
+ start: {
type: DataTypes.TIME,
allowNull: true
},
- updated_at: {
+ end: {
type: DataTypes.TIME,
allowNull: true
- },
- gold_per_min: {
- type: "DOUBLE(8,2)",
- allowNull: false
- },
- cs_per_min: {
- type: "DOUBLE(8,2)",
- allowNull: false
}
}, {
- tableName: 'player_stats',
+ tableName: 'series',
timestamps: false,
underscored: true,
freezeTableName: true