mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-20 19:06:06 +01:00
25 lines
499 B
JavaScript
25 lines
499 B
JavaScript
const { DataTypes, Model } = require('sequelize')
|
|
|
|
module.exports = (sequelize) => {
|
|
class UserPermission extends Model { }
|
|
|
|
UserPermission.init({
|
|
id: {
|
|
type: DataTypes.UUID,
|
|
defaultValue: DataTypes.UUIDV4,
|
|
primaryKey: true
|
|
},
|
|
key: DataTypes.STRING,
|
|
value: DataTypes.STRING
|
|
}, {
|
|
sequelize,
|
|
modelName: 'userPermission'
|
|
})
|
|
|
|
const { user } = sequelize.models
|
|
|
|
user.hasMany(UserPermission)
|
|
UserPermission.belongsTo(user)
|
|
|
|
return UserPermission
|
|
} |