From 6a951df4a98d808f970ecd290630a15456a66e16 Mon Sep 17 00:00:00 2001 From: schneefux Date: Mon, 10 Apr 2017 20:03:57 +0200 Subject: add builds table --- model.js | 4 +++- models/build.js | 45 +++++++++++++++++++++++++++++++++++++++++++++ models/global_point.js | 2 +- models/player_point.js | 2 +- models/skill_tier.js | 29 +++++++++++++++++++++++++++++ 5 files changed, 79 insertions(+), 3 deletions(-) create mode 100644 models/build.js create mode 100644 models/skill_tier.js diff --git a/model.js b/model.js index cb78ff7..37fdfac 100644 --- a/model.js +++ b/model.js @@ -16,6 +16,8 @@ module.exports = (seq, Seq) => { GameMode = seq.import("./models/game_mode.js"), Role = seq.import("./models/role.js"), Filter = seq.import("./models/filter.js"), + Skilltier = seq.import("./models/skill_tier.js"), + Build = seq.import("./models/build.js"), // Telemetry ItemParticipant = seq.import("./models/item_participant.js"), @@ -44,7 +46,7 @@ module.exports = (seq, Seq) => { return { Match, Roster, Participant, Player, Asset, - Item, Hero, Series, GameMode, Role, Filter, + Item, Hero, Series, GameMode, Role, Filter, Skilltier, Build, ItemParticipant, ParticipantStats, PlayerPoint, GlobalPoint, diff --git a/models/build.js b/models/build.js new file mode 100644 index 0000000..b789606 --- /dev/null +++ b/models/build.js @@ -0,0 +1,45 @@ +/* jshint indent: 2 */ + +module.exports = function(sequelize, DataTypes) { + return sequelize.define('build', { + id: { + type: DataTypes.INTEGER(10).UNSIGNED, + allowNull: false, + primaryKey: true, + autoIncrement: true + }, + name: { + type: DataTypes.STRING(191), + allowNull: false + }, + item_1: { + type: DataTypes.STRING(191), + allowNull: true + }, + item_2: { + type: DataTypes.STRING(191), + allowNull: true + }, + item_3: { + type: DataTypes.STRING(191), + allowNull: true + }, + item_4: { + type: DataTypes.STRING(191), + allowNull: true + }, + item_5: { + type: DataTypes.STRING(191), + allowNull: true + }, + item_6: { + type: DataTypes.STRING(191), + allowNull: true + } + }, { + tableName: 'build', + timestamps: false, + underscored: true, + freezeTableName: true + }); +}; diff --git a/models/global_point.js b/models/global_point.js index 52b6856..632560d 100644 --- a/models/global_point.js +++ b/models/global_point.js @@ -34,7 +34,7 @@ module.exports = function(sequelize, DataTypes) { }, build_id: { type: DataTypes.BIGINT, - allowNull: false + allowNull: true }, played: { type: DataTypes.BIGINT, diff --git a/models/player_point.js b/models/player_point.js index 8f6305e..ed9a6b1 100644 --- a/models/player_point.js +++ b/models/player_point.js @@ -9,7 +9,7 @@ module.exports = function(sequelize, DataTypes) { autoIncrement: true }, player_api_id: { - type: DataTypes.BIGINT, + type: DataTypes.CHAR(36), allowNull: false }, played: { diff --git a/models/skill_tier.js b/models/skill_tier.js new file mode 100644 index 0000000..f0af0be --- /dev/null +++ b/models/skill_tier.js @@ -0,0 +1,29 @@ +/* jshint indent: 2 */ + +module.exports = function(sequelize, DataTypes) { + return sequelize.define('skill_tier', { + id: { + type: DataTypes.INTEGER(10).UNSIGNED, + allowNull: false, + primaryKey: true, + autoIncrement: true + }, + name: { + type: DataTypes.STRING(191), + allowNull: false + }, + start: { + type: DataTypes.INTEGER(6), + allowNull: false + }, + end: { + type: DataTypes.INTEGER(6), + allowNull: false + } + }, { + tableName: 'skill_tier', + timestamps: false, + underscored: true, + freezeTableName: true + }); +}; -- cgit v1.3.1