Skip to content

Free, simple, and intuitive online database diagram editor and SQL generator.

Fix importing foreign keys from sqlite (#478)

1ilitae388291db7e
diff --git a/src/utils/importSQL/sqlite.js b/src/utils/importSQL/sqlite.js
index a2511aff..ecb07d9d 100644
--- a/src/utils/importSQL/sqlite.js
+++ b/src/utils/importSQL/sqlite.js
@@ -53,7 +53,7 @@ export function fromSQLite(ast, diagramDb = DB.GENERIC) {
const endTable = tables.find((t) => t.name === endTableName);
if (!endTable) return;
- const endField = endTable.fields.findIndex((f) => f.name === endFieldName);
+ const endField = endTable.fields.find((f) => f.name === endFieldName);
if (!endField) return;
const startField = startTable.fields.find((f) => f.name === startFieldName);