mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-07 09:51:37 +00:00
fix postgres oldUserId column casing
This commit is contained in:
parent
d5b509a9d7
commit
372a929255
2 changed files with 2 additions and 2 deletions
|
|
@ -435,7 +435,7 @@ class User extends Model {
|
|||
|
||||
const oldIdMatcher =
|
||||
this.sequelize.getDialect() === 'postgres'
|
||||
? sequelize.where(sequelize.literal(`"extraData"#>>'{oldUserId}'`), userId)
|
||||
? sequelize.where(sequelize.literal(`extradata#>>'{oldUserId}'`), userId)
|
||||
: { 'extraData.oldUserId': userId }
|
||||
|
||||
const user = await this.findOne({
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ describe('User model', () => {
|
|||
expect(findOneStub.calledOnce).to.equal(true)
|
||||
|
||||
const options = findOneStub.firstCall.args[0]
|
||||
expect(options.where.attribute.val).to.equal('"extraData"#>>\'{oldUserId}\'')
|
||||
expect(options.where.attribute.val).to.equal("extradata#>>'{oldUserId}'")
|
||||
expect(options.where.logic).to.equal('root')
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue