Browse Source

fix: mm unlink implementation

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5901/head
Pranav C 2 years ago
parent
commit
c9ebfad467
  1. 11
      packages/nocodb/src/db/BaseModelSqlv2.ts

11
packages/nocodb/src/db/BaseModelSqlv2.ts

@ -3773,15 +3773,18 @@ class BaseModelSqlv2 {
await this.dbDriver(vTn) await this.dbDriver(vTn)
.where({ .where({
[vParentCol.column_name]: this.dbDriver(parentTn)
.select(parentColumn.column_name)
.whereIn(parentTable.primaryKey.column_name, childIds)
.first(),
[vChildCol.column_name]: this.dbDriver(childTn) [vChildCol.column_name]: this.dbDriver(childTn)
.select(childColumn.column_name) .select(childColumn.column_name)
.where(_wherePk(childTable.primaryKeys, rowId)) .where(_wherePk(childTable.primaryKeys, rowId))
.first(), .first(),
}) })
.whereIn(
[vParentCol.column_name],
this.dbDriver(parentTn)
.select(parentColumn.column_name)
.whereIn(parentTable.primaryKey.column_name, childIds)
.first(),
)
.delete(); .delete();
} }
break; break;

Loading…
Cancel
Save