From ff1e83b8b5b0071163790469e5a140585ab3b62f Mon Sep 17 00:00:00 2001 From: 1ilit <1ilit@proton.me> Date: Sat, 28 Sep 2024 16:26:01 +0400 Subject: [PATCH] Fix import from postgres sql end field check --- src/utils/importSQL/postgres.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/importSQL/postgres.js b/src/utils/importSQL/postgres.js index bcc766f..1a0ba2a 100644 --- a/src/utils/importSQL/postgres.js +++ b/src/utils/importSQL/postgres.js @@ -120,7 +120,7 @@ export function fromPostgres(ast, diagramDb = DB.GENERIC) { const endFieldId = tables[endTableId].fields.findIndex( (f) => f.name === endField, ); - if (endField === -1) return; + if (endFieldId === -1) return; const startFieldId = table.fields.findIndex( (f) => f.name === startField, @@ -190,7 +190,7 @@ export function fromPostgres(ast, diagramDb = DB.GENERIC) { const endFieldId = tables[endTableId].fields.findIndex( (f) => f.name === endField, ); - if (endField === -1) return; + if (endFieldId === -1) return; const startFieldId = table.fields.findIndex( (f) => f.name === startField, @@ -314,7 +314,7 @@ export function fromPostgres(ast, diagramDb = DB.GENERIC) { const endFieldId = tables[endTableId].fields.findIndex( (f) => f.name === endField, ); - if (endField === -1) return; + if (endFieldId === -1) return; const startFieldId = tables[startTableId].fields.findIndex( (f) => f.name === startField,