coaches.ts
1.9 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
module.exports = function (sequelize: any, DataTypes: any) {
return sequelize.define('coaches', {
id: {
autoIncrement: true,
type: DataTypes.INTEGER,
allowNull: false,
primaryKey: true,
comment: "教练ID"
},
age: {
type: DataTypes.INTEGER,
allowNull: true,
comment: "年龄"
},
birthday: {
type: DataTypes.INTEGER,
allowNull: true,
comment: "生日 (0-未知)"
},
contract_until: {
type: DataTypes.INTEGER,
allowNull: true,
comment: "合同到期时间"
},
country_id: {
type: DataTypes.INTEGER,
allowNull: true,
comment: "国家ID"
},
joined: {
type: DataTypes.INTEGER,
allowNull: true,
comment: "加盟时间"
},
logo: {
type: DataTypes.STRING(255),
allowNull: true,
comment: "教练Logo"
},
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: "粤语名称"
},
nationality: {
type: DataTypes.STRING(255),
allowNull: true,
comment: "国籍"
},
preferred_formation: {
type: DataTypes.STRING(255),
allowNull: true,
comment: "习惯的阵型"
},
team_id: {
type: DataTypes.INTEGER,
allowNull: true,
comment: "执教球队ID"
},
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
},
type:{
type: DataTypes.INTEGER(11),
allowNull: true
},
});
};