audiobookshelf/server/models/LibraryFolder.js
2023-07-04 18:14:44 -05:00

23 lines
473 B
JavaScript

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