audiobookshelf/server/models/EBookFile.js
2023-03-12 14:51:45 -05:00

23 lines
436 B
JavaScript

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
}