Issue Description
When incrementing multiple fields using the object syntax, the field names are not transformed (eg to underscore), causing an error since the column doesn't exist. This is a regression from version 5.
What are you doing?
class MyModel extends Model {}
MyModel.init({
works: {
type: DataTypes.INTEGER,
defaultValue: 0,
},
longerField: {
type: DataTypes.INTEGER,
defaultValue: 0,
},
}, {
sequelize,
modelName: 'MyModel',
underscored: true,
})
await MyModel.increment({
works: 1,
longerField: 1,
});
// SequelizeDatabaseError column "longerField" does not exist
// While this works:
await MyModel.increment("longerField")
await MyModel.increment(["works", "longerField"])
What do you expect to happen?
It should convert to the correct field names and increment the right columns.
What is actually happening?
We get a SequelizeDatabaseError column "longerField" does not exist
Environment
- Sequelize version: 6.3.3
- Node.js version: 12.18.2
- Operating System: OSX 10.15.4
Issue Template Checklist
How does this problem relate to dialects?
Would you be willing to resolve this issue by submitting a Pull Request?
Issue Description
When incrementing multiple fields using the object syntax, the field names are not transformed (eg to underscore), causing an error since the column doesn't exist. This is a regression from version 5.
What are you doing?
What do you expect to happen?
It should convert to the correct field names and increment the right columns.
What is actually happening?
We get a
SequelizeDatabaseError column "longerField" does not existEnvironment
Issue Template Checklist
How does this problem relate to dialects?
Would you be willing to resolve this issue by submitting a Pull Request?