2023-03-08 19:33:52 +01:00
|
|
|
const { DataTypes, Model } = require('sequelize')
|
|
|
|
|
|
|
|
module.exports = (sequelize) => {
|
|
|
|
class User extends Model { }
|
|
|
|
|
|
|
|
User.init({
|
2023-03-12 20:51:45 +01:00
|
|
|
id: {
|
|
|
|
type: DataTypes.UUID,
|
|
|
|
defaultValue: DataTypes.UUIDV4,
|
|
|
|
primaryKey: true
|
|
|
|
},
|
|
|
|
username: DataTypes.STRING,
|
2023-03-12 23:55:12 +01:00
|
|
|
email: DataTypes.STRING,
|
2023-03-12 20:51:45 +01:00
|
|
|
pash: DataTypes.STRING,
|
|
|
|
type: DataTypes.STRING,
|
|
|
|
token: DataTypes.STRING,
|
2023-03-15 23:42:35 +01:00
|
|
|
isActive: {
|
|
|
|
type: DataTypes.BOOLEAN,
|
|
|
|
defaultValue: false
|
|
|
|
},
|
|
|
|
isLocked: {
|
|
|
|
type: DataTypes.BOOLEAN,
|
|
|
|
defaultValue: false
|
|
|
|
},
|
2023-03-18 22:56:57 +01:00
|
|
|
lastSeen: DataTypes.DATE,
|
|
|
|
extraData: DataTypes.JSON
|
2023-03-08 19:33:52 +01:00
|
|
|
}, {
|
|
|
|
sequelize,
|
2023-03-19 21:19:22 +01:00
|
|
|
modelName: 'user'
|
2023-03-08 19:33:52 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
return User
|
|
|
|
}
|