userModel.js
2.0 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
var sequelize = require('../config');
var Sequelize = require('sequelize');
var uuid = require('../util/UuidUtil')
var user = sequelize.define('3m_user', {
id: {
type: Sequelize.STRING(32),
defaultValue:uuid.db32(),
allowNull: false,
unique: true,
primaryKey: true,
field: "id"
},
loginName: {
allowNull: false,
type:Sequelize.STRING(100),
field: "login_name"
},
// IDcard: {
// allowNull: false,
// type:Sequelize.STRING(50),
// field: "IDcard"
// },
password: {
allowNull: false,
type:Sequelize.STRING(100),
field: "password"
},
// salt:{
// type:Sequelize.INTEGER(2),
// field: "salt"
// },
companyName:{
type:Sequelize.STRING(1024),
field: "company_name"
},
userName:{
type:Sequelize.STRING(64),
field: "user_name"
},
userType:{
type:Sequelize.INTEGER(1),
field: "user_type"
},
userRole:{
type:Sequelize.INTEGER(1),
field: "user_role"
},
userEmail:{
type:Sequelize.INTEGER(1),
field: "user_email"
},
userMobile:{
type:Sequelize.STRING(32),
field: "user_mobile"
},
createTime:{
type:Sequelize.DATE,
defaultValue:Sequelize.NOW,
field: "create_time"
},
endTime:{
type:Sequelize.DATE,
field: "end_time"
},
content:{
type:Sequelize.TEXT(1024),
field: "content"
},
serialNo:{
type:Sequelize.INTEGER(11),
field: "serial_no"
},
siteId:{
type:Sequelize.STRING(32),
field: "site_id"
},
userStatus:{
type:Sequelize.INTEGER(11),
field: "user_status"
},
groupId:{
type:Sequelize.STRING(128),
field: "group_id"
},
}, {
timestamps: false,
freezeTableName: true
});
module.exports = user;