-
Notifications
You must be signed in to change notification settings - Fork 0
/
userAddress.js
56 lines (56 loc) · 1.61 KB
/
userAddress.js
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
/**
* Created by itsx02 on 2016/8/8.
*/
module.exports = function (sequelize, DataTypes) {
return sequelize.define('UserAddress',
{
id: {
type: DataTypes.BIGINT(11),
autoIncrement: true,
primaryKey: true,
unique: true,
comment:'主键'
},
userId: {
type: DataTypes.BIGINT(11),
field: 'user_id',
allowNull: false,
comment:'用户Id'
},
consignee : {
type: DataTypes.STRING,
field: 'consignee',
allowNull: false,
comment:'收货人'
},
address: {
type: DataTypes.STRING(1024),
field: 'address',
allowNull: false,
comment:'详细地址'
},
zipCode: {
type: DataTypes.STRING(16),
field: 'zip_code',
allowNull: true,
comment:'邮编'
},
tel: {
type: DataTypes.STRING(32),
field: 'tel',
allowNull: false,
comment:'电话'
}
},
{
underscored: true,
timestamps: false,
freezeTableName: true,
tableName: 'userAddress',
comment: '用户地址表',
charset: 'utf8',
collate: 'utf8_general_ci',
indexes: [{ name: 'userAddress_userId', method: 'BTREE', fields: ['user_id'] }]
}
);
}