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
Knex version:2.4.2
Knex-postgis version: 0.14.3
Database + version: PostgreSQL 15.4 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-12), 64-bit
OS: Amazon RDS
Bug
We have a single update query as following: await knex('table') .update({ deleted: true, deleted_by: deletedBy, deleted_at: new Date(), }) .where({ id: _id, deleted: false });
all 3 columns, default are null;
However, I noticed in db, there are records that like following:
deleted: false,
deleted_by: xxxxx,
deleted_at: xxxxx
which means we updated deleted_by and deleted_at but didn't really update deleted in the above query.
So the question is:
Do anyone know why this is happening ? I don't necessary think its relate to knex but I am totally lost atm. Please help 🙏
Edit:
Few points that might help on analyse:
The table has no trigger at all
Only around 5% - 10% records are like this
There is no other places that update these columns
The text was updated successfully, but these errors were encountered:
Environment
Knex version:
2.4.2
Knex-postgis version:
0.14.3
Database + version: PostgreSQL 15.4 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 7.3.1 20180712 (Red Hat 7.3.1-12), 64-bit
OS: Amazon RDS
Bug
await knex('table') .update({ deleted: true, deleted_by: deletedBy, deleted_at: new Date(), }) .where({ id: _id, deleted: false });
all 3 columns, default are null;
However, I noticed in db, there are records that like following:
deleted: false,
deleted_by: xxxxx,
deleted_at: xxxxx
which means we updated
deleted_by
anddeleted_at
but didn't really updatedeleted
in the above query.So the question is:
Do anyone know why this is happening ? I don't necessary think its relate to knex but I am totally lost atm. Please help 🙏
Edit:
Few points that might help on analyse:
The text was updated successfully, but these errors were encountered: