summaryrefslogtreecommitdiff
path: root/models/tournament.js
blob: 1c1ff3261c2ebbd76456117443a566e7b34df6cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/* jshint indent: 2 */

module.exports = function(sequelize, DataTypes) {
  return sequelize.define('tournament', {
    id: {
      type: DataTypes.INTEGER(10).UNSIGNED,
      allowNull: false,
      primaryKey: true,
      autoIncrement: true
    },
    api_id: {
      type: DataTypes.STRING(191),
      allowNull: true
    },
    name: {
      type: DataTypes.STRING(191),
      allowNull: false
    },
    status: {
      type: DataTypes.ENUM('planned','active','finished'),
      allowNull: false
    },
    type: {
      type: DataTypes.ENUM('players','team'),
      allowNull: false
    },
    start: {
      type: DataTypes.TIME,
      allowNull: true
    },
    end: {
      type: DataTypes.TIME,
      allowNull: true
    },
    region: {
      type: DataTypes.STRING(191),
      allowNull: true
    }
  }, {
    tableName: 'tournament',
    timestamps: false,
    underscored: true,
    freezeTableName: true
  });
};