You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Model:destroy does not use the real 'field' name. #11112
// My model definitionclassMyModelextendsModel{}MyModel.init({userEmail: {type: DataTypes.STRING,field: 'user_email',primaryKey: true,},brandId: {type: DataTypes.INTEGER,field: 'brand_id',primaryKey: true,},description: {type: DataTypes.TEXT,allowNull: true,},},{
sequelize,modelName: 'myModel',tableName: 'my_table',underscored: true,timestamps: false,version: false,});// How I used to run the query before v5MyModel.destroy({ transaction,where: {userEmail: 'some email'}});
What do you expect to happen?
get this query: DELETE FROM my_table WHERE "user_email"='some email'
What is actually happening?
I'm getting this other one: DELETE FROM my_table WHERE "userEmail"='some email' producing column "userEmail" does not exist at character X
Environment
Dialect:
mysql
postgres
sqlite
mssql
any
Dialect library version: 7.8.0
Database version: 11.2
Sequelize version: tested with v5.8.12 and v6.0.0
Node Version: 10
OS: macOS
Activity
papb commentedon Jul 25, 2019
Closing in favor of #11225.
When #11225 gets closed, if anyone thinks this particular issue is still an issue, please ping me.