Browse Source

fix: skip mm hasmany relations

Signed-off-by: Pranav C <pranavxc@gmail.com>
test/reset-fail
Pranav C 2 years ago
parent
commit
37b1987cac
  1. 11
      packages/nocodb/src/db/BaseModelSqlv2.ts

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

@ -1909,9 +1909,12 @@ class BaseModelSqlv2 {
break;
case 'hm':
{
const relatedTable = await Model.get(
colOptions.fk_related_model_id,
);
// skip if it's an mm table column
const relatedTable = await colOptions.getRelatedTable();
if (relatedTable.mm) {
break;
}
const childColumn = await Column.get({
colId: colOptions.fk_child_column_id,
});
@ -1931,8 +1934,6 @@ class BaseModelSqlv2 {
}
break;
}
// await trx(this.model.table_name).where(column.column_name, id).del();
}
if (!trx) {

Loading…
Cancel
Save