Skip to content

Commit ff1e83b

Browse files
committed
Fix import from postgres sql end field check
1 parent d85be39 commit ff1e83b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/utils/importSQL/postgres.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export function fromPostgres(ast, diagramDb = DB.GENERIC) {
120120
const endFieldId = tables[endTableId].fields.findIndex(
121121
(f) => f.name === endField,
122122
);
123-
if (endField === -1) return;
123+
if (endFieldId === -1) return;
124124

125125
const startFieldId = table.fields.findIndex(
126126
(f) => f.name === startField,
@@ -190,7 +190,7 @@ export function fromPostgres(ast, diagramDb = DB.GENERIC) {
190190
const endFieldId = tables[endTableId].fields.findIndex(
191191
(f) => f.name === endField,
192192
);
193-
if (endField === -1) return;
193+
if (endFieldId === -1) return;
194194

195195
const startFieldId = table.fields.findIndex(
196196
(f) => f.name === startField,
@@ -314,7 +314,7 @@ export function fromPostgres(ast, diagramDb = DB.GENERIC) {
314314
const endFieldId = tables[endTableId].fields.findIndex(
315315
(f) => f.name === endField,
316316
);
317-
if (endField === -1) return;
317+
if (endFieldId === -1) return;
318318

319319
const startFieldId = tables[startTableId].fields.findIndex(
320320
(f) => f.name === startField,

0 commit comments

Comments
 (0)