audiobookshelf/server/models/LibrarySetting.js
2023-03-19 15:19:22 -05:00

25 lines
508 B
JavaScript

const { DataTypes, Model } = require('sequelize')
module.exports = (sequelize) => {
class LibrarySetting extends Model { }
LibrarySetting.init({
id: {
type: DataTypes.UUID,
defaultValue: DataTypes.UUIDV4,
primaryKey: true
},
key: DataTypes.STRING,
value: DataTypes.STRING
}, {
sequelize,
modelName: 'librarySetting'
})
const { library } = sequelize.models
library.hasMany(LibrarySetting)
LibrarySetting.belongsTo(library)
return LibrarySetting
}