Skip to content

Commit

Permalink
Fix import from postgres sql end field check
Browse files Browse the repository at this point in the history
  • Loading branch information
1ilit committed Sep 28, 2024
1 parent d85be39 commit ff1e83b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/importSQL/postgres.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit ff1e83b

Please sign in to comment.