Fixed the issue where all FKs are removed if one of the multiple FKs on the same column is removed.

refs #6891
pull/62/head
Aditya Toshniwal 2021-10-16 12:57:30 +05:30 committed by Akshay Joshi
parent a908ef7c61
commit c13b1b60e3
1 changed files with 2 additions and 2 deletions

View File

@ -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);
}
});