forked from Genaker/nodejento
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAdminUser.js
More file actions
132 lines (132 loc) · 2.99 KB
/
AdminUser.js
File metadata and controls
132 lines (132 loc) · 2.99 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
const Sequelize = require('sequelize');
module.exports = function(sequelize, DataTypes) {
return sequelize.define('AdminUser', {
user_id: {
autoIncrement: true,
type: DataTypes.INTEGER.UNSIGNED,
allowNull: false,
primaryKey: true,
comment: "User ID"
},
firstname: {
type: DataTypes.STRING(32),
allowNull: true,
comment: "User First Name"
},
lastname: {
type: DataTypes.STRING(32),
allowNull: true,
comment: "User Last Name"
},
email: {
type: DataTypes.STRING(128),
allowNull: true,
comment: "User Email"
},
username: {
type: DataTypes.STRING(40),
allowNull: true,
comment: "User Login",
unique: "ADMIN_USER_USERNAME"
},
password: {
type: DataTypes.STRING(255),
allowNull: false,
comment: "User Password"
},
created: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: Sequelize.Sequelize.fn('current_timestamp'),
comment: "User Created Time"
},
modified: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: Sequelize.Sequelize.fn('current_timestamp'),
comment: "User Modified Time"
},
logdate: {
type: DataTypes.DATE,
allowNull: true,
comment: "User Last Login Time"
},
lognum: {
type: DataTypes.SMALLINT.UNSIGNED,
allowNull: false,
defaultValue: 0,
comment: "User Login Number"
},
reload_acl_flag: {
type: DataTypes.SMALLINT,
allowNull: false,
defaultValue: 0,
comment: "Reload ACL"
},
is_active: {
type: DataTypes.SMALLINT,
allowNull: false,
defaultValue: 1,
comment: "User Is Active"
},
extra: {
type: DataTypes.TEXT,
allowNull: true,
comment: "User Extra Data"
},
rp_token: {
type: DataTypes.TEXT,
allowNull: true,
comment: "Reset Password Link Token"
},
rp_token_created_at: {
type: DataTypes.DATE,
allowNull: true,
comment: "Reset Password Link Token Creation Date"
},
interface_locale: {
type: DataTypes.STRING(16),
allowNull: false,
defaultValue: "en_US",
comment: "Backend interface locale"
},
failures_num: {
type: DataTypes.SMALLINT,
allowNull: true,
defaultValue: 0,
comment: "Failure Number"
},
first_failure: {
type: DataTypes.DATE,
allowNull: true,
comment: "First Failure"
},
lock_expires: {
type: DataTypes.DATE,
allowNull: true,
comment: "Expiration Lock Dates"
}
}, {
sequelize,
tableName: 'admin_user',
timestamps: false,
indexes: [
{
name: "PRIMARY",
unique: true,
using: "BTREE",
fields: [
{ name: "user_id" },
]
},
{
name: "ADMIN_USER_USERNAME",
unique: true,
using: "BTREE",
fields: [
{ name: "username" },
]
},
]
});
};