Fix corrupted endFieldIds after import

This commit is contained in:
1ilit 2024-09-28 18:02:49 +04:00
parent 935900d32b
commit 9fd682ccdc
4 changed files with 7 additions and 7 deletions

View File

@ -119,7 +119,7 @@ export function fromMariaDB(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,
@ -223,7 +223,7 @@ export function fromMariaDB(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,

View File

@ -131,7 +131,7 @@ export function fromMSSQL(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,
@ -235,7 +235,7 @@ export function fromMSSQL(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,

View File

@ -119,7 +119,7 @@ export function fromMySQL(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,
@ -223,7 +223,7 @@ export function fromMySQL(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,

View File

@ -136,7 +136,7 @@ export function fromSQLite(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,