diff --git a/packages/nocodb/src/db/BaseModelSqlv2.ts b/packages/nocodb/src/db/BaseModelSqlv2.ts index 43221a2a12..34b77f319d 100644 --- a/packages/nocodb/src/db/BaseModelSqlv2.ts +++ b/packages/nocodb/src/db/BaseModelSqlv2.ts @@ -1943,16 +1943,14 @@ class BaseModelSqlv2 { break; } } - + const where = await this._wherePk(id); if (!trx) { trx = await this.dbDriver.transaction(); } await Promise.all(execQueries.map((q) => q(trx))); - const response = await trx(this.tnPath) - .del() - .where(await this._wherePk(id)); + const response = await trx(this.tnPath).del().where(where); if (!_trx) await trx.commit();