Skip to content

Commit

Permalink
Fix corrupted endFieldIds after import
Browse files Browse the repository at this point in the history
  • Loading branch information
1ilit committed Sep 28, 2024
1 parent 935900d commit 9fd682c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/utils/importSQL/mariadb.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/utils/importSQL/mssql.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/utils/importSQL/mysql.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/utils/importSQL/sqlite.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 9fd682c

Please sign in to comment.