competitions.ts
2.6 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
module.exports = function (sequelize: any, DataTypes: any) {
return sequelize.define('competitions', {
id: {
type: DataTypes.INTEGER,
allowNull: false,
primaryKey: true,
comment: "赛事ID"
},
category_id: {
type: DataTypes.INTEGER,
allowNull: false,
comment: "分类ID"
},
country_id: {
type: DataTypes.INTEGER,
allowNull: false,
comment: "国家ID"
},
divisions: {
type: DataTypes.JSON,
allowNull: true,
comment: "赛事层级"
},
host: {
type: DataTypes.JSON,
allowNull: true,
comment: "东道主"
},
logo: {
type: DataTypes.STRING(255),
allowNull: true,
comment: "赛事Logo"
},
most_titles: {
type: DataTypes.JSON,
allowNull: true,
comment: "夺冠最多球队"
},
name_en: {
type: DataTypes.STRING(255),
allowNull: true,
comment: "英文名称"
},
name_zh: {
type: DataTypes.STRING(255),
allowNull: true,
comment: "中文名称"
},
name_zht: {
type: DataTypes.STRING(255),
allowNull: true,
comment: "粤语名称"
},
newcomers: {
type: DataTypes.JSON,
allowNull: true,
comment: "晋级淘汰球队"
},
primary_color: {
type: DataTypes.STRING(255),
allowNull: true,
comment: "主颜色"
},
secondary_color: {
type: DataTypes.STRING(255),
allowNull: true,
comment: "次颜色"
},
short_name_en: {
type: DataTypes.STRING(255),
allowNull: true,
comment: "英文简称"
},
short_name_zh: {
type: DataTypes.STRING(255),
allowNull: true,
comment: "中文简称"
},
short_name_zht: {
type: DataTypes.STRING(255),
allowNull: true,
comment: "粤语简称"
},
title_holder: {
type: DataTypes.JSON,
allowNull: true,
comment: "卫冕冠军"
},
type: {
type: DataTypes.INTEGER,
allowNull: true,
comment: "赛事类型,0-未知、1-联赛、2-杯赛、3-友谊赛"
},
updated_at: {
type: DataTypes.BIGINT,
allowNull: true,
get(){
return moment(this.getDataValue('updated_at')).format('YYYY-MM-DD HH:mm:ss');
}
},
created_at: {
type: DataTypes.DATE,
allowNull: true
},
best_players: {
type: DataTypes.JSON,
allowNull: true,
comment: "最佳球员"
},
best_teams: {
type: DataTypes.JSON,
allowNull: true,
comment: "最佳球队"
},
});
};