diff --git a/server/migrations/v2.17.7-add-indices.js b/server/migrations/v2.17.7-add-indices.js index 3d70ba20..b3821de8 100644 --- a/server/migrations/v2.17.7-add-indices.js +++ b/server/migrations/v2.17.7-add-indices.js @@ -22,6 +22,7 @@ async function up({ context: { queryInterface, logger } }) { logger.info(`${loggerPrefix} UPGRADE BEGIN: ${migrationName}`) await addIndex(queryInterface, logger, 'libraryItems', ['libraryId', 'mediaType', 'size']) + await addIndex(queryInterface, logger, 'books', ['duration']) logger.info(`${loggerPrefix} UPGRADE END: ${migrationName}`) } @@ -37,6 +38,7 @@ async function down({ context: { queryInterface, logger } }) { logger.info(`${loggerPrefix} DOWNGRADE BEGIN: ${migrationName}`) await removeIndex(queryInterface, logger, 'libraryItems', ['libraryId', 'mediaType', 'size']) + await removeIndex(queryInterface, logger, 'books', ['duration']) logger.info(`${loggerPrefix} DOWNGRADE END: ${migrationName}`) } diff --git a/server/models/Book.js b/server/models/Book.js index f7341db9..a904f536 100644 --- a/server/models/Book.js +++ b/server/models/Book.js @@ -321,10 +321,10 @@ class Book extends Model { // }, { fields: ['publishedYear'] + }, + { + fields: ['duration'] } - // { - // fields: ['duration'] - // } ] } )