Fix import from postgres sql end field check

This commit is contained in:
1ilit 2024-09-28 16:26:01 +04:00
parent d85be39b10
commit ff1e83b8b5

View File

@ -120,7 +120,7 @@ export function fromPostgres(ast, diagramDb = DB.GENERIC) {
const endFieldId = tables[endTableId].fields.findIndex( const endFieldId = tables[endTableId].fields.findIndex(
(f) => f.name === endField, (f) => f.name === endField,
); );
if (endField === -1) return; if (endFieldId === -1) return;
const startFieldId = table.fields.findIndex( const startFieldId = table.fields.findIndex(
(f) => f.name === startField, (f) => f.name === startField,
@ -190,7 +190,7 @@ export function fromPostgres(ast, diagramDb = DB.GENERIC) {
const endFieldId = tables[endTableId].fields.findIndex( const endFieldId = tables[endTableId].fields.findIndex(
(f) => f.name === endField, (f) => f.name === endField,
); );
if (endField === -1) return; if (endFieldId === -1) return;
const startFieldId = table.fields.findIndex( const startFieldId = table.fields.findIndex(
(f) => f.name === startField, (f) => f.name === startField,
@ -314,7 +314,7 @@ export function fromPostgres(ast, diagramDb = DB.GENERIC) {
const endFieldId = tables[endTableId].fields.findIndex( const endFieldId = tables[endTableId].fields.findIndex(
(f) => f.name === endField, (f) => f.name === endField,
); );
if (endField === -1) return; if (endFieldId === -1) return;
const startFieldId = tables[startTableId].fields.findIndex( const startFieldId = tables[startTableId].fields.findIndex(
(f) => f.name === startField, (f) => f.name === startField,