From 25e66d9cb0e02764aece94873f7a459b1d48e5a3 Mon Sep 17 00:00:00 2001 From: schneefux Date: Sat, 1 Apr 2017 13:16:44 +0200 Subject: generate from db --- models/item.js | 4 ++++ models/participant_ext.js | 4 ---- models/player_ext.js | 24 +++++++++++++----------- models/roster_ext.js | 32 -------------------------------- 4 files changed, 17 insertions(+), 47 deletions(-) (limited to 'models') diff --git a/models/item.js b/models/item.js index 6f2aac9..0168c1b 100644 --- a/models/item.js +++ b/models/item.js @@ -16,6 +16,10 @@ module.exports = function(sequelize, DataTypes) { type: DataTypes.TIME, allowNull: true }, + api_id: { + type: DataTypes.STRING(191), + allowNull: false + }, series: { type: DataTypes.STRING(191), allowNull: false diff --git a/models/participant_ext.js b/models/participant_ext.js index abcb5ed..6622359 100644 --- a/models/participant_ext.js +++ b/models/participant_ext.js @@ -8,10 +8,6 @@ module.exports = function(sequelize, DataTypes) { primaryKey: true, autoIncrement: true }, - series: { - type: DataTypes.STRING(191), - allowNull: false - }, participant_api_id: { type: DataTypes.STRING(191), allowNull: false, diff --git a/models/player_ext.js b/models/player_ext.js index 6d0a369..55c56ab 100644 --- a/models/player_ext.js +++ b/models/player_ext.js @@ -3,8 +3,10 @@ module.exports = function(sequelize, DataTypes) { return sequelize.define('player_ext', { id: { - type: DataTypes.INTEGER(11), - allowNull: false + type: DataTypes.INTEGER(10).UNSIGNED, + allowNull: false, + primaryKey: true, + autoIncrement: true }, player_api_id: { type: DataTypes.STRING(191), @@ -13,35 +15,35 @@ module.exports = function(sequelize, DataTypes) { }, played: { type: DataTypes.INTEGER(11), - allowNull: false + allowNull: true }, played_ranked: { type: DataTypes.INTEGER(11), - allowNull: false + allowNull: true }, played_casual: { type: DataTypes.INTEGER(11), - allowNull: false + allowNull: true }, played_brawl: { type: DataTypes.INTEGER(11), - allowNull: false + allowNull: true }, wins: { type: DataTypes.INTEGER(11), - allowNull: false + allowNull: true }, wins_ranked: { type: DataTypes.INTEGER(11), - allowNull: false + allowNull: true }, wins_casual: { type: DataTypes.INTEGER(11), - allowNull: false + allowNull: true }, wins_brawl: { type: DataTypes.INTEGER(11), - allowNull: false + allowNull: true }, skill_tier: { type: DataTypes.STRING(191), @@ -61,7 +63,7 @@ module.exports = function(sequelize, DataTypes) { }, streak: { type: DataTypes.STRING(191), - allowNull: false + allowNull: true } }, { tableName: 'player_ext', diff --git a/models/roster_ext.js b/models/roster_ext.js index 1f7c37d..4a3098b 100644 --- a/models/roster_ext.js +++ b/models/roster_ext.js @@ -11,38 +11,6 @@ module.exports = function(sequelize, DataTypes) { roster_api_id: { type: DataTypes.STRING(191), allowNull: false - }, - kills: { - type: DataTypes.INTEGER(11), - allowNull: false - }, - assists: { - type: DataTypes.INTEGER(11), - allowNull: false - }, - deaths: { - type: DataTypes.INTEGER(11), - allowNull: false - }, - gold: { - type: DataTypes.INTEGER(11), - allowNull: false - }, - kraken_captures: { - type: DataTypes.INTEGER(11), - allowNull: false - }, - side: { - type: DataTypes.STRING(191), - allowNull: false - }, - turret_captures: { - type: DataTypes.INTEGER(11), - allowNull: false - }, - turrets_remaining: { - type: DataTypes.INTEGER(11), - allowNull: false } }, { tableName: 'roster_ext', -- cgit v1.3.1