From c9ca32cdecb2627605e68b07f1f386ef12a4d626 Mon Sep 17 00:00:00 2001 From: schneefux Date: Thu, 30 Mar 2017 15:12:22 +0200 Subject: add imported db models --- models/hero_core_stats.js | 66 ++++++++++++++++++++++++++ models/hero_dimension.js | 30 ++++++++++++ models/hero_stats.js | 38 +++++++++++++++ models/heros.js | 82 ++++++++++++++++++++++++++++++++ models/item.js | 38 +++++++++++++++ models/keys.js | 34 ++++++++++++++ models/match.js | 48 +++++++++++++++++++ models/match_dimension.js | 30 ++++++++++++ models/match_stats.js | 14 ++++++ models/migrations.js | 22 +++++++++ models/participant.js | 103 +++++++++++++++++++++++++++++++++++++++++ models/participant_ext.js | 39 ++++++++++++++++ models/participant_item_use.js | 31 +++++++++++++ models/player.js | 47 +++++++++++++++++++ models/player_dimension.js | 30 ++++++++++++ models/player_ext.js | 61 ++++++++++++++++++++++++ models/roster.js | 54 +++++++++++++++++++++ models/stats_dimensions.js | 26 +++++++++++ 18 files changed, 793 insertions(+) create mode 100644 models/hero_core_stats.js create mode 100644 models/hero_dimension.js create mode 100644 models/hero_stats.js create mode 100644 models/heros.js create mode 100644 models/item.js create mode 100644 models/keys.js create mode 100644 models/match.js create mode 100644 models/match_dimension.js create mode 100644 models/match_stats.js create mode 100644 models/migrations.js create mode 100644 models/participant.js create mode 100644 models/participant_ext.js create mode 100644 models/participant_item_use.js create mode 100644 models/player.js create mode 100644 models/player_dimension.js create mode 100644 models/player_ext.js create mode 100644 models/roster.js create mode 100644 models/stats_dimensions.js (limited to 'models') diff --git a/models/hero_core_stats.js b/models/hero_core_stats.js new file mode 100644 index 0000000..1accc6a --- /dev/null +++ b/models/hero_core_stats.js @@ -0,0 +1,66 @@ +/* jshint indent: 2 */ + +module.exports = function(sequelize, DataTypes) { + return sequelize.define('hero_core_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 + }, + patch_version: { + type: DataTypes.STRING(191), + allowNull: false + }, + hp: { + type: "DOUBLE", + allowNull: false + }, + energy: { + type: "DOUBLE", + allowNull: false + }, + weapon_damage: { + type: "DOUBLE", + allowNull: false + }, + attack_speed: { + type: "DOUBLE", + allowNull: false + }, + armor: { + type: "DOUBLE", + allowNull: false + }, + shield: { + type: "DOUBLE", + allowNull: false + }, + attack_range: { + type: "DOUBLE", + allowNull: false + }, + move_speed: { + type: "DOUBLE", + allowNull: false + }, + hp_regen: { + type: "DOUBLE", + allowNull: false + }, + ep_regen: { + type: "DOUBLE", + allowNull: false + } + }, { + tableName: 'hero_core_stats' + }); +}; diff --git a/models/hero_dimension.js b/models/hero_dimension.js new file mode 100644 index 0000000..300ea69 --- /dev/null +++ b/models/hero_dimension.js @@ -0,0 +1,30 @@ +/* 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' + }); +}; diff --git a/models/hero_stats.js b/models/hero_stats.js new file mode 100644 index 0000000..514f141 --- /dev/null +++ b/models/hero_stats.js @@ -0,0 +1,38 @@ +/* jshint indent: 2 */ + +module.exports = function(sequelize, DataTypes) { + return sequelize.define('hero_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 + }, + pick_rate: { + type: "DOUBLE(8,2)", + allowNull: false + }, + win_rate: { + type: "DOUBLE(8,2)", + allowNull: false + }, + gold_per_min: { + type: "DOUBLE(8,2)", + allowNull: false + }, + cs_per_min: { + type: "DOUBLE(8,2)", + allowNull: false + } + }, { + tableName: 'hero_stats' + }); +}; diff --git a/models/heros.js b/models/heros.js new file mode 100644 index 0000000..9848656 --- /dev/null +++ b/models/heros.js @@ -0,0 +1,82 @@ +/* jshint indent: 2 */ + +module.exports = function(sequelize, DataTypes) { + return sequelize.define('heros', { + 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 + }, + added_in_patch: { + type: DataTypes.STRING(191), + allowNull: false + }, + name: { + type: DataTypes.STRING(191), + allowNull: false + }, + api_name: { + type: DataTypes.STRING(191), + allowNull: false + }, + is_assassin: { + type: DataTypes.INTEGER(1), + allowNull: false + }, + is_mage: { + type: DataTypes.INTEGER(1), + allowNull: false + }, + is_protector: { + type: DataTypes.INTEGER(1), + allowNull: false + }, + is_sniper: { + type: DataTypes.INTEGER(1), + allowNull: false + }, + is_warrior: { + type: DataTypes.INTEGER(1), + allowNull: false + }, + is_carry: { + type: DataTypes.INTEGER(1), + allowNull: false + }, + is_jungler: { + type: DataTypes.INTEGER(1), + allowNull: false + }, + is_captain: { + type: DataTypes.INTEGER(1), + allowNull: false + }, + heroic_perk: { + type: DataTypes.STRING(191), + allowNull: false + }, + ability_a: { + type: DataTypes.STRING(191), + allowNull: false + }, + ability_b: { + type: DataTypes.STRING(191), + allowNull: false + }, + ability_c: { + type: DataTypes.STRING(191), + allowNull: false + } + }, { + tableName: 'heros' + }); +}; diff --git a/models/item.js b/models/item.js new file mode 100644 index 0000000..b3fbbf3 --- /dev/null +++ b/models/item.js @@ -0,0 +1,38 @@ +/* jshint indent: 2 */ + +module.exports = function(sequelize, DataTypes) { + return sequelize.define('item', { + 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 + }, + patch_version: { + type: DataTypes.STRING(191), + allowNull: false + }, + name: { + type: DataTypes.STRING(191), + allowNull: false + }, + active: { + type: DataTypes.STRING(191), + allowNull: false + }, + passive: { + type: DataTypes.STRING(191), + allowNull: false + } + }, { + tableName: 'item' + }); +}; diff --git a/models/keys.js b/models/keys.js new file mode 100644 index 0000000..96ff65b --- /dev/null +++ b/models/keys.js @@ -0,0 +1,34 @@ +/* jshint indent: 2 */ + +module.exports = function(sequelize, DataTypes) { + return sequelize.define('keys', { + 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: { + type: DataTypes.STRING(191), + allowNull: false + }, + key: { + type: DataTypes.STRING(191), + allowNull: false + }, + value: { + type: DataTypes.STRING(191), + allowNull: false + } + }, { + tableName: 'keys' + }); +}; diff --git a/models/match.js b/models/match.js new file mode 100644 index 0000000..18f179a --- /dev/null +++ b/models/match.js @@ -0,0 +1,48 @@ +/* jshint indent: 2 */ + +module.exports = function(sequelize, DataTypes) { + return sequelize.define('match', { + id: { + type: DataTypes.INTEGER(10).UNSIGNED, + allowNull: false, + primaryKey: true, + autoIncrement: true + }, + api_id: { + type: DataTypes.STRING(191), + allowNull: false, + unique: true + }, + created_at: { + type: DataTypes.DATE, + allowNull: false, + defaultValue: sequelize.literal('CURRENT_TIMESTAMP') + }, + duration: { + type: DataTypes.INTEGER(11), + allowNull: false + }, + game_mode: { + type: DataTypes.STRING(191), + allowNull: false + }, + patch_version: { + type: DataTypes.STRING(191), + allowNull: false + }, + shard_id: { + type: DataTypes.STRING(191), + allowNull: false + }, + end_game_reason: { + type: DataTypes.STRING(191), + allowNull: false + }, + queue: { + type: DataTypes.STRING(191), + allowNull: false + } + }, { + tableName: 'match' + }); +}; diff --git a/models/match_dimension.js b/models/match_dimension.js new file mode 100644 index 0000000..c6c0c45 --- /dev/null +++ b/models/match_dimension.js @@ -0,0 +1,30 @@ +/* jshint indent: 2 */ + +module.exports = function(sequelize, DataTypes) { + return sequelize.define('match_dimension', { + id: { + type: DataTypes.INTEGER(10).UNSIGNED, + allowNull: false, + primaryKey: true, + autoIncrement: true + }, + match_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: 'match_dimension' + }); +}; diff --git a/models/match_stats.js b/models/match_stats.js new file mode 100644 index 0000000..1317cf3 --- /dev/null +++ b/models/match_stats.js @@ -0,0 +1,14 @@ +/* jshint indent: 2 */ + +module.exports = function(sequelize, DataTypes) { + return sequelize.define('match_stats', { + id: { + type: DataTypes.INTEGER(10).UNSIGNED, + allowNull: false, + primaryKey: true, + autoIncrement: true + } + }, { + tableName: 'match_stats' + }); +}; diff --git a/models/migrations.js b/models/migrations.js new file mode 100644 index 0000000..5bee87e --- /dev/null +++ b/models/migrations.js @@ -0,0 +1,22 @@ +/* jshint indent: 2 */ + +module.exports = function(sequelize, DataTypes) { + return sequelize.define('migrations', { + id: { + type: DataTypes.INTEGER(10).UNSIGNED, + allowNull: false, + primaryKey: true, + autoIncrement: true + }, + migration: { + type: DataTypes.STRING(191), + allowNull: false + }, + batch: { + type: DataTypes.INTEGER(11), + allowNull: false + } + }, { + tableName: 'migrations' + }); +}; diff --git a/models/participant.js b/models/participant.js new file mode 100644 index 0000000..18ba729 --- /dev/null +++ b/models/participant.js @@ -0,0 +1,103 @@ +/* jshint indent: 2 */ + +module.exports = function(sequelize, DataTypes) { + return sequelize.define('participant', { + id: { + type: DataTypes.INTEGER(10).UNSIGNED, + allowNull: false, + primaryKey: true, + autoIncrement: true + }, + api_id: { + type: DataTypes.STRING(191), + allowNull: false, + unique: true + }, + player_api_id: { + type: DataTypes.STRING(191), + allowNull: false + }, + roster_api_id: { + type: DataTypes.STRING(191), + allowNull: false + }, + created_at: { + type: DataTypes.TIME, + allowNull: true + }, + actor: { + type: DataTypes.STRING(191), + allowNull: false + }, + assists: { + type: DataTypes.INTEGER(11), + allowNull: false + }, + crystal_mine_captures: { + type: DataTypes.INTEGER(11), + allowNull: false + }, + deaths: { + type: DataTypes.INTEGER(11), + allowNull: false + }, + farm: { + type: "DOUBLE", + allowNull: false + }, + first_afk_time: { + type: "DOUBLE", + allowNull: false + }, + gold_mine_captures: { + type: DataTypes.INTEGER(11), + allowNull: false + }, + jungle_kills: { + type: DataTypes.INTEGER(11), + allowNull: false + }, + karma_level: { + type: DataTypes.INTEGER(11), + allowNull: false + }, + kills: { + type: DataTypes.INTEGER(11), + allowNull: false + }, + kraken_captures: { + type: DataTypes.INTEGER(11), + allowNull: false + }, + level: { + type: DataTypes.INTEGER(11), + allowNull: false + }, + minion_kills: { + type: DataTypes.INTEGER(11), + allowNull: false + }, + skill_tier: { + type: DataTypes.INTEGER(11), + allowNull: false + }, + skin_key: { + type: DataTypes.STRING(191), + allowNull: false + }, + turret_captures: { + type: DataTypes.INTEGER(11), + allowNull: false + }, + went_afk: { + type: DataTypes.INTEGER(1), + allowNull: false + }, + winner: { + type: DataTypes.INTEGER(1), + allowNull: false + } + }, { + tableName: 'participant' + }); +}; diff --git a/models/participant_ext.js b/models/participant_ext.js new file mode 100644 index 0000000..070eb93 --- /dev/null +++ b/models/participant_ext.js @@ -0,0 +1,39 @@ +/* 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 + }, + patch_version: { + type: DataTypes.STRING(191), + allowNull: false + }, + 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' + }); +}; diff --git a/models/participant_item_use.js b/models/participant_item_use.js new file mode 100644 index 0000000..0055650 --- /dev/null +++ b/models/participant_item_use.js @@ -0,0 +1,31 @@ +/* jshint indent: 2 */ + +module.exports = function(sequelize, DataTypes) { + return sequelize.define('participant_item_use', { + id: { + type: DataTypes.INTEGER(10).UNSIGNED, + allowNull: false, + primaryKey: true, + autoIncrement: true + }, + participant_id: { + type: DataTypes.STRING(191), + allowNull: false, + unique: true + }, + item_id: { + type: DataTypes.STRING(191), + allowNull: false + }, + action: { + type: DataTypes.STRING(191), + allowNull: false + }, + timeFromStart: { + type: DataTypes.INTEGER(11), + allowNull: false + } + }, { + tableName: 'participant_item_use' + }); +}; diff --git a/models/player.js b/models/player.js new file mode 100644 index 0000000..605029e --- /dev/null +++ b/models/player.js @@ -0,0 +1,47 @@ +/* jshint indent: 2 */ + +module.exports = function(sequelize, DataTypes) { + return sequelize.define('player', { + id: { + type: DataTypes.INTEGER(10).UNSIGNED, + allowNull: false, + primaryKey: true, + autoIncrement: true + }, + api_id: { + type: DataTypes.STRING(191), + allowNull: false, + unique: true + }, + created_at: { + type: DataTypes.TIME, + allowNull: true + }, + name: { + type: DataTypes.STRING(191), + allowNull: false + }, + shard_id: { + type: DataTypes.STRING(191), + allowNull: true + }, + last_match_created_date: { + type: DataTypes.TIME, + allowNull: true + }, + level: { + type: DataTypes.INTEGER(11), + allowNull: false + }, + xp: { + type: DataTypes.INTEGER(11), + allowNull: false + }, + lifetime_gold: { + type: "DOUBLE(8,2)", + allowNull: false + } + }, { + tableName: 'player' + }); +}; diff --git a/models/player_dimension.js b/models/player_dimension.js new file mode 100644 index 0000000..40556ae --- /dev/null +++ b/models/player_dimension.js @@ -0,0 +1,30 @@ +/* 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' + }); +}; diff --git a/models/player_ext.js b/models/player_ext.js new file mode 100644 index 0000000..f2ca5d4 --- /dev/null +++ b/models/player_ext.js @@ -0,0 +1,61 @@ +/* jshint indent: 2 */ + +module.exports = function(sequelize, DataTypes) { + return sequelize.define('player_ext', { + id: { + type: DataTypes.INTEGER(11), + allowNull: false + }, + api_id: { + type: DataTypes.STRING(191), + allowNull: false, + unique: true + }, + patch_version: { + type: DataTypes.STRING(191), + allowNull: false + }, + played: { + type: DataTypes.INTEGER(11), + allowNull: false + }, + played_ranked: { + type: DataTypes.INTEGER(11), + allowNull: false + }, + played_casual: { + type: DataTypes.INTEGER(11), + allowNull: false + }, + played_brawl: { + type: DataTypes.INTEGER(11), + allowNull: false + }, + wins: { + type: DataTypes.INTEGER(11), + allowNull: false + }, + wins_ranked: { + type: DataTypes.INTEGER(11), + allowNull: false + }, + wins_casual: { + type: DataTypes.INTEGER(11), + allowNull: false + }, + wins_brawl: { + type: DataTypes.INTEGER(11), + allowNull: false + }, + skill_tier: { + type: DataTypes.STRING(191), + allowNull: true + }, + streak: { + type: DataTypes.STRING(191), + allowNull: false + } + }, { + tableName: 'player_ext' + }); +}; diff --git a/models/roster.js b/models/roster.js new file mode 100644 index 0000000..fb4b129 --- /dev/null +++ b/models/roster.js @@ -0,0 +1,54 @@ +/* jshint indent: 2 */ + +module.exports = function(sequelize, DataTypes) { + return sequelize.define('roster', { + id: { + type: DataTypes.INTEGER(10).UNSIGNED, + allowNull: false, + primaryKey: true, + autoIncrement: true + }, + match_api_id: { + type: DataTypes.STRING(191), + allowNull: false + }, + api_id: { + type: DataTypes.STRING(191), + allowNull: false, + unique: true + }, + aces_earned: { + type: DataTypes.INTEGER(11), + allowNull: false + }, + gold: { + type: DataTypes.INTEGER(11), + allowNull: false + }, + hero_kills: { + type: DataTypes.INTEGER(11), + allowNull: false + }, + kraken_captures: { + type: DataTypes.INTEGER(11), + allowNull: false + }, + side: { + type: DataTypes.STRING(191), + allowNull: false + }, + team_color: { + type: DataTypes.STRING(191) + }, + turret_kills: { + type: DataTypes.INTEGER(11), + allowNull: false + }, + turrets_remaining: { + type: DataTypes.INTEGER(11), + allowNull: false + } + }, { + tableName: 'roster' + }); +}; diff --git a/models/stats_dimensions.js b/models/stats_dimensions.js new file mode 100644 index 0000000..c299a2c --- /dev/null +++ b/models/stats_dimensions.js @@ -0,0 +1,26 @@ +/* jshint indent: 2 */ + +module.exports = function(sequelize, DataTypes) { + return sequelize.define('stats_dimensions', { + id: { + type: DataTypes.INTEGER(10).UNSIGNED, + allowNull: false, + primaryKey: true, + autoIncrement: true + }, + dimension_on: { + type: DataTypes.STRING(191), + allowNull: false + }, + name: { + type: DataTypes.STRING(191), + allowNull: false + }, + value: { + type: DataTypes.STRING(191), + allowNull: false + } + }, { + tableName: 'stats_dimensions' + }); +}; -- cgit v1.3.1