diff --git a/src/utils/importSQL/mariadb.js b/src/utils/importSQL/mariadb.js index 563200ef..0bcf4a12 100644 --- a/src/utils/importSQL/mariadb.js +++ b/src/utils/importSQL/mariadb.js @@ -105,7 +105,7 @@ export function fromMariaDB(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 fromMariaDB(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; diff --git a/src/utils/importSQL/mssql.js b/src/utils/importSQL/mssql.js index 740f7441..71d6510d 100644 --- a/src/utils/importSQL/mssql.js +++ b/src/utils/importSQL/mssql.js @@ -117,7 +117,7 @@ export function fromMSSQL(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; @@ -199,7 +199,7 @@ export function fromMSSQL(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; 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; diff --git a/src/utils/importSQL/postgres.js b/src/utils/importSQL/postgres.js index 2912404c..1cdb1266 100644 --- a/src/utils/importSQL/postgres.js +++ b/src/utils/importSQL/postgres.js @@ -105,7 +105,7 @@ export function fromPostgres(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; @@ -278,7 +278,7 @@ export function fromPostgres(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; diff --git a/src/utils/importSQL/sqlite.js b/src/utils/importSQL/sqlite.js index 5bd3a1bd..9c89a4a1 100644 --- a/src/utils/importSQL/sqlite.js +++ b/src/utils/importSQL/sqlite.js @@ -122,7 +122,7 @@ export function fromSQLite(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;