fix postgres oldUserId column casing

This commit is contained in:
Kevin Gatera 2026-03-02 19:55:23 -05:00
parent d5b509a9d7
commit 372a929255
No known key found for this signature in database
GPG key ID: F0D9F5932458CFB9
2 changed files with 2 additions and 2 deletions

View file

@ -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({

View file

@ -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')
})