From c13b1b60e36392fa696ff2406686bb74566fddd0 Mon Sep 17 00:00:00 2001 From: Aditya Toshniwal Date: Sat, 16 Oct 2021 12:57:30 +0530 Subject: [PATCH] Fixed the issue where all FKs are removed if one of the multiple FKs on the same column is removed. refs #6891 --- web/pgadmin/tools/erd/static/js/erd_tool/ERDCore.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/pgadmin/tools/erd/static/js/erd_tool/ERDCore.js b/web/pgadmin/tools/erd/static/js/erd_tool/ERDCore.js index 44ffca5e0..eaf7de600 100644 --- a/web/pgadmin/tools/erd/static/js/erd_tool/ERDCore.js +++ b/web/pgadmin/tools/erd/static/js/erd_tool/ERDCore.js @@ -342,8 +342,8 @@ export default class ERDCore { tableData.foreign_key?.forEach((theFkRow)=>{ let theFk = theFkRow.columns[0]; let attnum = _.find(tableNode.getColumns(), (col)=>col.name==theFk.local_column).attnum; - /* Skip all those whose attnum matches to the link */ - if(linkData.local_column_attnum != attnum) { + /* Skip all those whose attnum and table matches to the link */ + if(linkData.local_column_attnum != attnum || linkData.referenced_table_uid != theFk.references) { newForeingKeys.push(theFkRow); } });