mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-20 19:06:06 +01:00
23 lines
473 B
JavaScript
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
|
||
|
}
|