Skip to content

Commit

Permalink
Fix remaining case sensitive foreign key comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
ruizhii committed Oct 27, 2024
1 parent 9d68dd9 commit dcf73e6
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 @@ -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;
Expand Down Expand Up @@ -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;
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 @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/utils/importSQL/postgres.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
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 @@ -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;
Expand Down

0 comments on commit dcf73e6

Please sign in to comment.