-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathusers.js
29 lines (29 loc) · 972 Bytes
/
users.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
"use strict";
module.exports = (sequelize, DataTypes) => {
const users = sequelize.define(
"users",
{
UserId: {
type: DataTypes.INTEGER,
allowNull: false,
autoIncrement: true,
primaryKey: true
},
FirstName: DataTypes.STRING,
MiddleName: DataTypes.STRING,
LastName: DataTypes.STRING,
Username: { type: DataTypes.STRING, unique: true },
Password: DataTypes.STRING,
Email: { type: DataTypes.STRING, unique: true },
Admin: { type: DataTypes.BOOLEAN, defaultValue: false },
Deleted: { type: DataTypes.BOOLEAN, defaultValue: false },
lastLogin: { type: DataTypes.DATE, defaultValue: sequelize.literal('CURRENT_TIMESTAMP') },
joined: { type: DataTypes.DATE, defaultValue: sequelize.literal('CURRENT_TIMESTAMP') },
},
{}
);
users.associate = function(models) {
// associations can be defined here
};
return users;
};