Skip to content

Commit 9fd682c

Browse files
committed
Fix corrupted endFieldIds after import
1 parent 935900d commit 9fd682c

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/utils/importSQL/mariadb.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export function fromMariaDB(ast, diagramDb = DB.GENERIC) {
119119
const endFieldId = tables[endTableId].fields.findIndex(
120120
(f) => f.name === endField,
121121
);
122-
if (endField === -1) return;
122+
if (endFieldId === -1) return;
123123

124124
const startFieldId = table.fields.findIndex(
125125
(f) => f.name === startField,
@@ -223,7 +223,7 @@ export function fromMariaDB(ast, diagramDb = DB.GENERIC) {
223223
const endFieldId = tables[endTableId].fields.findIndex(
224224
(f) => f.name === endField,
225225
);
226-
if (endField === -1) return;
226+
if (endFieldId === -1) return;
227227

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

src/utils/importSQL/mssql.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export function fromMSSQL(ast, diagramDb = DB.GENERIC) {
131131
const endFieldId = tables[endTableId].fields.findIndex(
132132
(f) => f.name === endField,
133133
);
134-
if (endField === -1) return;
134+
if (endFieldId === -1) return;
135135

136136
const startFieldId = table.fields.findIndex(
137137
(f) => f.name === startField,
@@ -235,7 +235,7 @@ export function fromMSSQL(ast, diagramDb = DB.GENERIC) {
235235
const endFieldId = tables[endTableId].fields.findIndex(
236236
(f) => f.name === endField,
237237
);
238-
if (endField === -1) return;
238+
if (endFieldId === -1) return;
239239

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

src/utils/importSQL/mysql.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export function fromMySQL(ast, diagramDb = DB.GENERIC) {
119119
const endFieldId = tables[endTableId].fields.findIndex(
120120
(f) => f.name === endField,
121121
);
122-
if (endField === -1) return;
122+
if (endFieldId === -1) return;
123123

124124
const startFieldId = table.fields.findIndex(
125125
(f) => f.name === startField,
@@ -223,7 +223,7 @@ export function fromMySQL(ast, diagramDb = DB.GENERIC) {
223223
const endFieldId = tables[endTableId].fields.findIndex(
224224
(f) => f.name === endField,
225225
);
226-
if (endField === -1) return;
226+
if (endFieldId === -1) return;
227227

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

src/utils/importSQL/sqlite.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export function fromSQLite(ast, diagramDb = DB.GENERIC) {
136136
const endFieldId = tables[endTableId].fields.findIndex(
137137
(f) => f.name === endField,
138138
);
139-
if (endField === -1) return;
139+
if (endFieldId === -1) return;
140140

141141
const startFieldId = table.fields.findIndex(
142142
(f) => f.name === startField,

0 commit comments

Comments
 (0)