audiobookshelf/server/models/EBookFile.js

23 lines
436 B
JavaScript
Raw Normal View History

2023-03-12 20:51:45 +01:00
const { DataTypes, Model } = require('sequelize')
module.exports = (sequelize) => {
class EBookFile extends Model { }
EBookFile.init({
id: {
type: DataTypes.UUID,
defaultValue: DataTypes.UUIDV4,
primaryKey: true
}
}, {
sequelize,
modelName: 'EBookFile'
})
const { FileMetadata } = sequelize.models
FileMetadata.hasOne(EBookFile)
EBookFile.belongsTo(FileMetadata)
return EBookFile
}