Merge pull request #282 from ruizhiii/fix/foreign-key-case-sensitive
Fix foreign key comparison case sensitive
This commit is contained in:
commit
35d55a02f1
@ -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 relationship = {};
|
||||||
const startTableId = table.id;
|
const startTableId = table.id;
|
||||||
const startTable = e.table[0].table;
|
const startTable = e.table[0].table;
|
||||||
@ -187,7 +187,7 @@ export function fromMariaDB(ast, diagramDb = DB.GENERIC) {
|
|||||||
e.expr.forEach((expr) => {
|
e.expr.forEach((expr) => {
|
||||||
if (
|
if (
|
||||||
expr.action === "add" &&
|
expr.action === "add" &&
|
||||||
expr.create_definitions.constraint_type === "FOREIGN KEY"
|
expr.create_definitions.constraint_type.toLowerCase() === "foreign key"
|
||||||
) {
|
) {
|
||||||
const relationship = {};
|
const relationship = {};
|
||||||
const startTable = e.table[0].table;
|
const startTable = e.table[0].table;
|
||||||
|
@ -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 relationship = {};
|
||||||
const startTableId = table.id;
|
const startTableId = table.id;
|
||||||
const startTable = e.table[0].table;
|
const startTable = e.table[0].table;
|
||||||
@ -199,7 +199,7 @@ export function fromMSSQL(ast, diagramDb = DB.GENERIC) {
|
|||||||
e.expr.forEach((expr) => {
|
e.expr.forEach((expr) => {
|
||||||
if (
|
if (
|
||||||
expr.action === "add" &&
|
expr.action === "add" &&
|
||||||
expr.create_definitions.constraint_type === "FOREIGN KEY"
|
expr.create_definitions.constraint_type.toLowerCase() === "foreign key"
|
||||||
) {
|
) {
|
||||||
const relationship = {};
|
const relationship = {};
|
||||||
const startTable = e.table[0].table;
|
const startTable = e.table[0].table;
|
||||||
|
@ -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 relationship = {};
|
||||||
const startTableId = table.id;
|
const startTableId = table.id;
|
||||||
const startTable = e.table[0].table;
|
const startTable = e.table[0].table;
|
||||||
@ -187,7 +187,7 @@ export function fromMySQL(ast, diagramDb = DB.GENERIC) {
|
|||||||
e.expr.forEach((expr) => {
|
e.expr.forEach((expr) => {
|
||||||
if (
|
if (
|
||||||
expr.action === "add" &&
|
expr.action === "add" &&
|
||||||
expr.create_definitions.constraint_type === "FOREIGN KEY"
|
expr.create_definitions.constraint_type.toLowerCase() === "foreign key"
|
||||||
) {
|
) {
|
||||||
const relationship = {};
|
const relationship = {};
|
||||||
const startTable = e.table[0].table;
|
const startTable = e.table[0].table;
|
||||||
|
@ -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 relationship = {};
|
||||||
const startTableId = table.id;
|
const startTableId = table.id;
|
||||||
const startTable = e.table[0].table;
|
const startTable = e.table[0].table;
|
||||||
@ -278,7 +278,7 @@ export function fromPostgres(ast, diagramDb = DB.GENERIC) {
|
|||||||
e.expr.forEach((expr) => {
|
e.expr.forEach((expr) => {
|
||||||
if (
|
if (
|
||||||
expr.action === "add" &&
|
expr.action === "add" &&
|
||||||
expr.create_definitions.constraint_type === "FOREIGN KEY"
|
expr.create_definitions.constraint_type.toLowerCase() === "foreign key"
|
||||||
) {
|
) {
|
||||||
const relationship = {};
|
const relationship = {};
|
||||||
const startTable = e.table[0].table;
|
const startTable = e.table[0].table;
|
||||||
|
@ -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 relationship = {};
|
||||||
const startTableId = table.id;
|
const startTableId = table.id;
|
||||||
const startTable = e.table[0].table;
|
const startTable = e.table[0].table;
|
||||||
|
Loading…
Reference in New Issue
Block a user