Skip to content

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

Fix foreign key comparison case sensitive

zhi9d68dd918518
diff --git a/src/utils/importSQL/mysql.js b/src/utils/importSQL/mysql.js
index f8b37151..075b3789 100644
--- a/src/utils/importSQL/mysql.js
+++ b/src/utils/importSQL/mysql.js
@@ -105,7 +105,7 @@ export function fromMySQL(ast, diagramDb = DB.GENERIC) {
}
});
});
- } else if (d.constraint_type === "FOREIGN KEY") {
+ } else if (d.constraint_type.toLowerCase() === "foreign key") {
const relationship = {};
const startTableId = table.id;
const startTable = e.table[0].table;
@@ -187,7 +187,7 @@ export function fromMySQL(ast, diagramDb = DB.GENERIC) {
e.expr.forEach((expr) => {
if (
expr.action === "add" &&
- expr.create_definitions.constraint_type === "FOREIGN KEY"
+ expr.create_definitions.constraint_type.toLowerCase() === "foreign key"
) {
const relationship = {};
const startTable = e.table[0].table;