Complete migration file

This commit is contained in:
advplyr 2023-03-18 16:56:57 -05:00
parent b8de041497
commit 243bc7b0d0
22 changed files with 1203 additions and 162 deletions

View file

@ -30,8 +30,8 @@ module.exports = (sequelize) => {
LibraryItem.hasOne(Book)
Book.belongsTo(LibraryItem)
FileMetadata.hasOne(Book)
Book.belongsTo(FileMetadata, { as: 'ImageFile' }) // Ref: https://sequelize.org/docs/v6/core-concepts/assocs/#defining-an-alias
FileMetadata.hasOne(Book, { foreignKey: 'ImageFileId ' })
Book.belongsTo(FileMetadata, { as: 'ImageFile', foreignKey: 'ImageFileId' }) // Ref: https://sequelize.org/docs/v6/core-concepts/assocs/#defining-an-alias
EBookFile.hasOne(Book)
Book.belongsTo(EBookFile)