diff options
Diffstat (limited to 'models')
| -rw-r--r-- | models/asset.js | 2 | ||||
| -rw-r--r-- | models/global_point.js | 4 | ||||
| -rw-r--r-- | models/global_point_bans.js | 53 | ||||
| -rw-r--r-- | models/global_point_phase.js | 209 | ||||
| -rw-r--r-- | models/match.js | 2 | ||||
| -rw-r--r-- | models/participant.js | 2 | ||||
| -rw-r--r-- | models/participant_items.js | 42 | ||||
| -rw-r--r-- | models/participant_phases.js | 100 | ||||
| -rw-r--r-- | models/team.js | 2 | ||||
| -rw-r--r-- | models/team_membership.js | 2 | ||||
| -rw-r--r-- | models/tournament.js | 16 | ||||
| -rw-r--r-- | models/tournament_participants.js | 8 | ||||
| -rw-r--r-- | models/users.js | 16 |
13 files changed, 402 insertions, 56 deletions
diff --git a/models/asset.js b/models/asset.js index bc60b3e..32382a2 100644 --- a/models/asset.js +++ b/models/asset.js @@ -36,7 +36,7 @@ module.exports = function(sequelize, DataTypes) { created_at: { type: DataTypes.TIME, allowNull: false, - defaultValue: sequelize.fn('current_timestamp') + defaultValue: sequelize.literal('CURRENT_TIMESTAMP') }, description: { type: DataTypes.STRING(191), diff --git a/models/global_point.js b/models/global_point.js index 38b1920..54be2ff 100644 --- a/models/global_point.js +++ b/models/global_point.js @@ -119,6 +119,10 @@ module.exports = function(sequelize, DataTypes) { impact_score: { type: DataTypes.BIGINT, allowNull: true + }, + surrender: { + type: "DOUBLE", + allowNull: true } }, { tableName: 'global_point', diff --git a/models/global_point_bans.js b/models/global_point_bans.js new file mode 100644 index 0000000..4cc4fc5 --- /dev/null +++ b/models/global_point_bans.js @@ -0,0 +1,53 @@ +/* jshint indent: 2 */ + +module.exports = function(sequelize, DataTypes) { + return sequelize.define('global_point_bans', { + id: { + type: DataTypes.INTEGER(10).UNSIGNED, + allowNull: false, + primaryKey: true, + autoIncrement: true + }, + updated_at: { + type: DataTypes.DATE, + allowNull: false + }, + series_id: { + type: DataTypes.BIGINT, + allowNull: false + }, + filter_id: { + type: DataTypes.BIGINT, + allowNull: false + }, + hero_id: { + type: DataTypes.BIGINT, + allowNull: false + }, + game_mode_id: { + type: DataTypes.BIGINT, + allowNull: false + }, + skill_tier_id: { + type: DataTypes.BIGINT, + allowNull: false + }, + region_id: { + type: DataTypes.BIGINT, + allowNull: true + }, + played: { + type: DataTypes.BIGINT, + allowNull: true + }, + bans: { + type: DataTypes.BIGINT, + allowNull: true + } + }, { + tableName: 'global_point_bans', + timestamps: false, + underscored: true, + freezeTableName: true + }); +}; diff --git a/models/global_point_phase.js b/models/global_point_phase.js new file mode 100644 index 0000000..2180d99 --- /dev/null +++ b/models/global_point_phase.js @@ -0,0 +1,209 @@ +/* jshint indent: 2 */ + +module.exports = function(sequelize, DataTypes) { + return sequelize.define('global_point_phase', { + id: { + type: DataTypes.INTEGER(10).UNSIGNED, + allowNull: false, + primaryKey: true, + autoIncrement: true + }, + updated_at: { + type: DataTypes.DATE, + allowNull: false + }, + series_id: { + type: DataTypes.BIGINT, + allowNull: false + }, + filter_id: { + type: DataTypes.BIGINT, + allowNull: false + }, + hero_id: { + type: DataTypes.BIGINT, + allowNull: false + }, + game_mode_id: { + type: DataTypes.BIGINT, + allowNull: false + }, + skill_tier_id: { + type: DataTypes.BIGINT, + allowNull: false + }, + build_id: { + type: DataTypes.BIGINT, + allowNull: true + }, + role_id: { + type: DataTypes.BIGINT, + allowNull: true + }, + region_id: { + type: DataTypes.BIGINT, + allowNull: true + }, + phase_start: { + type: DataTypes.BIGINT, + allowNull: true + }, + phase_end: { + type: DataTypes.BIGINT, + allowNull: true + }, + played: { + type: DataTypes.BIGINT, + allowNull: true + }, + wins: { + type: DataTypes.BIGINT, + allowNull: true + }, + time_spent: { + type: DataTypes.BIGINT, + allowNull: true + }, + kills: { + type: DataTypes.BIGINT, + allowNull: true + }, + deaths: { + type: DataTypes.BIGINT, + allowNull: true + }, + assists: { + type: DataTypes.BIGINT, + allowNull: true + }, + farm: { + type: DataTypes.BIGINT, + allowNull: true + }, + minion_kills: { + type: DataTypes.BIGINT, + allowNull: true + }, + jungle_kills: { + type: DataTypes.BIGINT, + allowNull: true + }, + non_jungle_minion_kills: { + type: DataTypes.BIGINT, + allowNull: true + }, + crystal_mine_captures: { + type: DataTypes.BIGINT, + allowNull: true + }, + gold_mine_captures: { + type: DataTypes.BIGINT, + allowNull: true + }, + kraken_captures: { + type: DataTypes.BIGINT, + allowNull: true + }, + turret_captures: { + type: DataTypes.BIGINT, + allowNull: true + }, + gold: { + type: DataTypes.BIGINT, + allowNull: true + }, + dmg_true_hero: { + type: "DOUBLE", + allowNull: true + }, + dmg_true_kraken: { + type: "DOUBLE", + allowNull: true + }, + dmg_true_turret: { + type: "DOUBLE", + allowNull: true + }, + dmg_true_vain_turret: { + type: "DOUBLE", + allowNull: true + }, + dmg_true_others: { + type: "DOUBLE", + allowNull: true + }, + dmg_dealt_hero: { + type: "DOUBLE", + allowNull: true + }, + dmg_dealt_kraken: { + type: "DOUBLE", + allowNull: true + }, + dmg_dealt_turret: { + type: "DOUBLE", + allowNull: true + }, + dmg_dealt_vain_turret: { + type: "DOUBLE", + allowNull: true + }, + dmg_dealt_others: { + type: "DOUBLE", + allowNull: true + }, + dmg_rcvd_dealt_hero: { + type: "DOUBLE", + allowNull: true + }, + dmg_rcvd_true_hero: { + type: "DOUBLE", + allowNull: true + }, + dmg_rcvd_dealt_others: { + type: "DOUBLE", + allowNull: true + }, + dmg_rcvd_true_others: { + type: "DOUBLE", + allowNull: true + }, + ability_a_level: { + type: DataTypes.INTEGER(3).UNSIGNED, + allowNull: true + }, + ability_b_level: { + type: DataTypes.INTEGER(3).UNSIGNED, + allowNull: true + }, + ability_c_level: { + type: DataTypes.INTEGER(3).UNSIGNED, + allowNull: true + }, + hero_level: { + type: DataTypes.INTEGER(3).UNSIGNED, + 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 + } + }, { + tableName: 'global_point_phase', + timestamps: false, + underscored: true, + freezeTableName: true + }); +}; diff --git a/models/match.js b/models/match.js index dfc0b71..5ded026 100644 --- a/models/match.js +++ b/models/match.js @@ -20,7 +20,7 @@ module.exports = function(sequelize, DataTypes) { created_at: { type: DataTypes.TIME, allowNull: false, - defaultValue: sequelize.fn('current_timestamp') + defaultValue: sequelize.literal('CURRENT_TIMESTAMP') }, duration: { type: DataTypes.INTEGER(5).UNSIGNED, diff --git a/models/participant.js b/models/participant.js index 5579f31..2f208df 100644 --- a/models/participant.js +++ b/models/participant.js @@ -52,7 +52,7 @@ module.exports = function(sequelize, DataTypes) { created_at: { type: DataTypes.TIME, allowNull: false, - defaultValue: sequelize.fn('current_timestamp') + defaultValue: sequelize.literal('CURRENT_TIMESTAMP') }, actor: { type: DataTypes.STRING(16), diff --git a/models/participant_items.js b/models/participant_items.js new file mode 100644 index 0000000..5d3c3b7 --- /dev/null +++ b/models/participant_items.js @@ -0,0 +1,42 @@ +/* jshint indent: 2 */ + +module.exports = function(sequelize, DataTypes) { + return sequelize.define('participant_items', { + id: { + type: DataTypes.INTEGER(10).UNSIGNED, + allowNull: false, + primaryKey: true, + autoIncrement: true + }, + shard_id: { + type: DataTypes.STRING(191), + allowNull: false + }, + participant_api_id: { + type: DataTypes.CHAR(36), + allowNull: false, + unique: true + }, + items: { + type: "BLOB", + allowNull: false + }, + item_grants: { + type: "BLOB", + allowNull: false + }, + item_uses: { + type: "BLOB", + allowNull: false + }, + item_sells: { + type: "BLOB", + allowNull: false + } + }, { + tableName: 'participant_items', + timestamps: false, + underscored: true, + freezeTableName: true + }); +}; diff --git a/models/participant_phases.js b/models/participant_phases.js index 4d45e02..3780b90 100644 --- a/models/participant_phases.js +++ b/models/participant_phases.js @@ -240,49 +240,89 @@ module.exports = function(sequelize, DataTypes) { type: "DOUBLE", allowNull: true }, - items: { - type: DataTypes.STRING(191), + draft_position: { + type: DataTypes.INTEGER(11), allowNull: true }, - item_grants: { - type: DataTypes.STRING(191), + ban: { + type: DataTypes.INTEGER(11), allowNull: true }, - item_sells: { - type: DataTypes.STRING(191), + pick: { + type: DataTypes.INTEGER(11), allowNull: true }, - ability_levels: { - type: DataTypes.STRING(191), - allowNull: true + items: { + type: "BLOB", + allowNull: false }, - ability_uses: { - type: DataTypes.STRING(191), - allowNull: true + item_grants: { + type: "BLOB", + allowNull: false }, - ability_damage: { - type: DataTypes.STRING(191), - allowNull: true + item_sells: { + type: "BLOB", + allowNull: false }, - item_uses: { - type: DataTypes.STRING(191), - allowNull: true + ability_a_use: { + type: DataTypes.INTEGER(5).UNSIGNED, + allowNull: false }, - player_damage: { - type: DataTypes.STRING(191), - allowNull: true + ability_b_use: { + type: DataTypes.INTEGER(5).UNSIGNED, + allowNull: false }, - draft_position: { - type: DataTypes.INTEGER(11), - allowNull: true + ability_c_use: { + type: DataTypes.INTEGER(5).UNSIGNED, + allowNull: false }, - ban: { - type: DataTypes.INTEGER(11), - allowNull: true + ability_a_damage_true: { + type: DataTypes.INTEGER(10).UNSIGNED, + allowNull: false }, - pick: { - type: DataTypes.INTEGER(11), - allowNull: true + ability_a_damage_dealt: { + type: DataTypes.INTEGER(10).UNSIGNED, + allowNull: false + }, + ability_b_damage_true: { + type: DataTypes.INTEGER(10).UNSIGNED, + allowNull: false + }, + ability_b_damage_dealt: { + type: DataTypes.INTEGER(10).UNSIGNED, + allowNull: false + }, + ability_c_damage_true: { + type: DataTypes.INTEGER(10).UNSIGNED, + allowNull: false + }, + ability_c_damage_dealt: { + type: DataTypes.INTEGER(10).UNSIGNED, + allowNull: false + }, + ability_aa_damage_true: { + type: DataTypes.INTEGER(10).UNSIGNED, + allowNull: false + }, + ability_aa_damage_dealt: { + type: DataTypes.INTEGER(10).UNSIGNED, + allowNull: false + }, + ability_aacrit_damage_true: { + type: DataTypes.INTEGER(10).UNSIGNED, + allowNull: false + }, + ability_aacrit_damage_dealt: { + type: DataTypes.INTEGER(10).UNSIGNED, + allowNull: false + }, + item_uses: { + type: "BLOB", + allowNull: false + }, + player_damage: { + type: "BLOB", + allowNull: false } }, { tableName: 'participant_phases', diff --git a/models/team.js b/models/team.js index e320afb..eab927f 100644 --- a/models/team.js +++ b/models/team.js @@ -19,7 +19,7 @@ module.exports = function(sequelize, DataTypes) { created_at: { type: DataTypes.TIME, allowNull: false, - defaultValue: sequelize.fn('current_timestamp') + defaultValue: sequelize.literal('CURRENT_TIMESTAMP') }, name: { type: DataTypes.STRING(20), diff --git a/models/team_membership.js b/models/team_membership.js index eee2061..755e7bc 100644 --- a/models/team_membership.js +++ b/models/team_membership.js @@ -23,7 +23,7 @@ module.exports = function(sequelize, DataTypes) { joined_on: { type: DataTypes.TIME, allowNull: false, - defaultValue: sequelize.fn('current_timestamp') + defaultValue: sequelize.literal('CURRENT_TIMESTAMP') }, status: { type: DataTypes.ENUM('pending','initiate','member','officer','leader','former','veteran'), diff --git a/models/tournament.js b/models/tournament.js index 56ca5cf..27de855 100644 --- a/models/tournament.js +++ b/models/tournament.js @@ -16,6 +16,14 @@ module.exports = function(sequelize, DataTypes) { type: DataTypes.STRING(191), allowNull: false }, + tag_line_1: { + type: DataTypes.STRING(191), + allowNull: true + }, + tag_line_2: { + type: DataTypes.STRING(191), + allowNull: true + }, status: { type: DataTypes.ENUM('planned','active','finished'), allowNull: false @@ -35,14 +43,6 @@ module.exports = function(sequelize, DataTypes) { region: { type: DataTypes.STRING(191), allowNull: true - }, - tag_line_1: { - type: DataTypes.STRING(255), - allowNull: true - }, - tag_line_2: { - type: DataTypes.STRING(255), - allowNull: true } }, { tableName: 'tournament', diff --git a/models/tournament_participants.js b/models/tournament_participants.js index 092f8a8..284ca42 100644 --- a/models/tournament_participants.js +++ b/models/tournament_participants.js @@ -16,13 +16,13 @@ module.exports = function(sequelize, DataTypes) { type: DataTypes.BIGINT, allowNull: false }, + role_id: { + type: DataTypes.BIGINT, + allowNull: false + }, player_api_id: { type: DataTypes.CHAR(36), allowNull: false - }, - role_id: { - type: DataTypes.INTEGER(11), - allowNull: true } }, { tableName: 'tournament_participants', diff --git a/models/users.js b/models/users.js index 853e441..b82ba74 100644 --- a/models/users.js +++ b/models/users.js @@ -14,24 +14,22 @@ module.exports = function(sequelize, DataTypes) { }, user_token: { type: DataTypes.CHAR(36), - allowNull: false, - defaultValue: '-1' + allowNull: true }, player_api_id: { type: DataTypes.CHAR(36), - allowNull: true, - defaultValue: '' + allowNull: true }, email: { - type: DataTypes.STRING(100), - allowNull: true + type: DataTypes.STRING(191), + allowNull: false }, password: { - type: DataTypes.STRING(100), - allowNull: true + type: DataTypes.STRING(191), + allowNull: false }, remember_token: { - type: DataTypes.STRING(255), + type: DataTypes.STRING(191), allowNull: true }, access_type: { |
