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/player.js | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 models/player.js (limited to 'models/player.js') 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' + }); +}; -- cgit v1.3.1