Fix library query sort by title, add indexes for books and libraryItems

This commit is contained in:
advplyr 2023-08-10 17:46:27 -05:00
parent 8c9fc3ddb5
commit aac2879652
3 changed files with 40 additions and 3 deletions

View file

@ -151,7 +151,27 @@ module.exports = (sequelize) => {
genres: DataTypes.JSON
}, {
sequelize,
modelName: 'book'
modelName: 'book',
indexes: [
{
fields: [{
name: 'title',
collate: 'NOCASE'
}]
},
{
fields: [{
name: 'titleIgnorePrefix',
collate: 'NOCASE'
}]
},
{
fields: ['publishedYear']
},
{
fields: ['duration']
}
]
})
return Book