diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-04-01 12:06:49 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-04-01 12:06:49 +0200 |
| commit | 55eacbdff9003723a747715e4c75f8f743c5d2bd (patch) | |
| tree | 20e14a6cbbc2225d723c3a8f9df206ed6adc92c7 | |
| parent | 90077fffc279fec3d3a0d02c7a701a20b3888fe2 (diff) | |
| download | orm-55eacbdff9003723a747715e4c75f8f743c5d2bd.tar.gz orm-55eacbdff9003723a747715e4c75f8f743c5d2bd.zip | |
patch _exts to allow nulls, add autoincrements where needed
| -rw-r--r-- | models/player.js | 2 | ||||
| -rw-r--r-- | models/player_ext.js | 22 |
2 files changed, 13 insertions, 11 deletions
diff --git a/models/player.js b/models/player.js index 827e9fc..a0583dc 100644 --- a/models/player.js +++ b/models/player.js @@ -10,7 +10,7 @@ module.exports = function(sequelize, DataTypes) { }, shard_id: { type: DataTypes.STRING(191), - allowNull: true + allowNull: false }, api_id: { type: DataTypes.STRING(191), diff --git a/models/player_ext.js b/models/player_ext.js index 183faf9..f31b790 100644 --- a/models/player_ext.js +++ b/models/player_ext.js @@ -4,7 +4,9 @@ module.exports = function(sequelize, DataTypes) { return sequelize.define('player_ext', { id: { type: DataTypes.INTEGER(11), - allowNull: false + 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), @@ -49,7 +51,7 @@ module.exports = function(sequelize, DataTypes) { }, streak: { type: DataTypes.STRING(191), - allowNull: false + allowNull: true } }, { tableName: 'player_ext', |
