audiobookshelf/server/models/LibraryFolder.js

23 lines
473 B
JavaScript
Raw Permalink Normal View History

2023-03-12 20:51:45 +01:00
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,
2023-03-19 21:19:22 +01:00
modelName: 'libraryFolder'
2023-03-12 20:51:45 +01:00
})
2023-03-19 21:19:22 +01:00
const { library } = sequelize.models
library.hasMany(LibraryFolder)
LibraryFolder.belongsTo(library)
2023-03-12 20:51:45 +01:00
return LibraryFolder
}