mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-30 22:59:37 +02:00
Update bookSeries & bookAuthors table to include createdAt timestamp
This commit is contained in:
parent
4dbe8d29d9
commit
4d0acb30ba
9 changed files with 447 additions and 407 deletions
|
@ -1,4 +1,4 @@
|
|||
const { DataTypes, Model } = require('sequelize')
|
||||
const { DataTypes, Model, literal } = require('sequelize')
|
||||
const Logger = require('../Logger')
|
||||
const oldLibraryItem = require('../objects/LibraryItem')
|
||||
const libraryFilters = require('../utils/queries/libraryFilters')
|
||||
|
@ -70,13 +70,13 @@ module.exports = (sequelize) => {
|
|||
{
|
||||
model: sequelize.models.author,
|
||||
through: {
|
||||
attributes: []
|
||||
attributes: ['createdAt']
|
||||
}
|
||||
},
|
||||
{
|
||||
model: sequelize.models.series,
|
||||
through: {
|
||||
attributes: ['sequence']
|
||||
attributes: ['sequence', 'createdAt']
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -85,6 +85,12 @@ module.exports = (sequelize) => {
|
|||
model: sequelize.models.podcast
|
||||
}
|
||||
],
|
||||
order: [
|
||||
['createdAt', 'ASC'],
|
||||
// Ensure author & series stay in the same order
|
||||
[sequelize.models.book, sequelize.models.author, sequelize.models.bookAuthor, 'createdAt', 'ASC'],
|
||||
[sequelize.models.book, sequelize.models.series, 'bookSeries', 'createdAt', 'ASC'],
|
||||
],
|
||||
offset,
|
||||
limit
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue