audiobookshelf/server/models/User.js
2023-03-15 17:42:35 -05:00

32 lines
637 B
JavaScript

const { DataTypes, Model } = require('sequelize')
module.exports = (sequelize) => {
class User extends Model { }
User.init({
id: {
type: DataTypes.UUID,
defaultValue: DataTypes.UUIDV4,
primaryKey: true
},
username: DataTypes.STRING,
email: DataTypes.STRING,
pash: DataTypes.STRING,
type: DataTypes.STRING,
token: DataTypes.STRING,
isActive: {
type: DataTypes.BOOLEAN,
defaultValue: false
},
isLocked: {
type: DataTypes.BOOLEAN,
defaultValue: false
},
lastSeen: DataTypes.DATE
}, {
sequelize,
modelName: 'User'
})
return User
}