mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-05-22 01:18:13 +02:00
Add index on duration
This commit is contained in:
parent
754c121168
commit
0444829a9f
@ -22,6 +22,7 @@ async function up({ context: { queryInterface, logger } }) {
|
|||||||
logger.info(`${loggerPrefix} UPGRADE BEGIN: ${migrationName}`)
|
logger.info(`${loggerPrefix} UPGRADE BEGIN: ${migrationName}`)
|
||||||
|
|
||||||
await addIndex(queryInterface, logger, 'libraryItems', ['libraryId', 'mediaType', 'size'])
|
await addIndex(queryInterface, logger, 'libraryItems', ['libraryId', 'mediaType', 'size'])
|
||||||
|
await addIndex(queryInterface, logger, 'books', ['duration'])
|
||||||
|
|
||||||
logger.info(`${loggerPrefix} UPGRADE END: ${migrationName}`)
|
logger.info(`${loggerPrefix} UPGRADE END: ${migrationName}`)
|
||||||
}
|
}
|
||||||
@ -37,6 +38,7 @@ async function down({ context: { queryInterface, logger } }) {
|
|||||||
logger.info(`${loggerPrefix} DOWNGRADE BEGIN: ${migrationName}`)
|
logger.info(`${loggerPrefix} DOWNGRADE BEGIN: ${migrationName}`)
|
||||||
|
|
||||||
await removeIndex(queryInterface, logger, 'libraryItems', ['libraryId', 'mediaType', 'size'])
|
await removeIndex(queryInterface, logger, 'libraryItems', ['libraryId', 'mediaType', 'size'])
|
||||||
|
await removeIndex(queryInterface, logger, 'books', ['duration'])
|
||||||
|
|
||||||
logger.info(`${loggerPrefix} DOWNGRADE END: ${migrationName}`)
|
logger.info(`${loggerPrefix} DOWNGRADE END: ${migrationName}`)
|
||||||
}
|
}
|
||||||
|
@ -321,10 +321,10 @@ class Book extends Model {
|
|||||||
// },
|
// },
|
||||||
{
|
{
|
||||||
fields: ['publishedYear']
|
fields: ['publishedYear']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fields: ['duration']
|
||||||
}
|
}
|
||||||
// {
|
|
||||||
// fields: ['duration']
|
|
||||||
// }
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user