summaryrefslogtreecommitdiff
path: root/models/team.js
diff options
context:
space:
mode:
Diffstat (limited to 'models/team.js')
-rw-r--r--models/team.js50
1 files changed, 50 insertions, 0 deletions
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
+ });
+};