From 0f1fef88ca050a3160069594fcff7e19e1899676 Mon Sep 17 00:00:00 2001 From: schneefux Date: Thu, 4 May 2017 13:24:52 +0200 Subject: import teams --- models/team.js | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 models/team.js (limited to 'models/team.js') diff --git a/models/team.js b/models/team.js new file mode 100644 index 0000000..c9a7880 --- /dev/null +++ b/models/team.js @@ -0,0 +1,50 @@ +/* jshint indent: 2 */ + +module.exports = function(sequelize, DataTypes) { + return sequelize.define('team', { + id: { + type: DataTypes.INTEGER(10).UNSIGNED, + allowNull: false, + primaryKey: true, + autoIncrement: true + }, + shard_id: { + type: DataTypes.STRING(5), + allowNull: true + }, + api_id: { + type: DataTypes.CHAR(36), + allowNull: true + }, + created_at: { + type: DataTypes.TIME, + allowNull: false, + defaultValue: sequelize.literal('CURRENT_TIMESTAMP') + }, + tournament_id: { + type: DataTypes.BIGINT, + allowNull: true + }, + name: { + type: DataTypes.STRING(20), + allowNull: false + }, + identifier: { + type: DataTypes.STRING(10), + allowNull: false + }, + status: { + type: DataTypes.ENUM('planned','active','inactive'), + allowNull: false + }, + type: { + type: DataTypes.ENUM('team','guild','tournament'), + allowNull: false + } + }, { + tableName: 'team', + timestamps: false, + underscored: true, + freezeTableName: true + }); +}; -- cgit v1.3.1