Handle null as default
This commit is contained in:
parent
583138949b
commit
aad1469496
@ -56,6 +56,8 @@ export function astToDiagram(ast) {
|
|||||||
.join(", ") +
|
.join(", ") +
|
||||||
")";
|
")";
|
||||||
}
|
}
|
||||||
|
} else if (d.default_val.value.type === "null") {
|
||||||
|
defaultValue = "NULL";
|
||||||
} else {
|
} else {
|
||||||
defaultValue = d.default_val.value.value.toString();
|
defaultValue = d.default_val.value.value.toString();
|
||||||
}
|
}
|
||||||
@ -189,7 +191,6 @@ export function astToDiagram(ast) {
|
|||||||
expr.action === "add" &&
|
expr.action === "add" &&
|
||||||
expr.create_definitions.constraint_type === "FOREIGN KEY"
|
expr.create_definitions.constraint_type === "FOREIGN KEY"
|
||||||
) {
|
) {
|
||||||
console.log(e);
|
|
||||||
const relationship = {};
|
const relationship = {};
|
||||||
const startTable = e.table[0].table;
|
const startTable = e.table[0].table;
|
||||||
const startField = expr.create_definitions.definition[0].column;
|
const startField = expr.create_definitions.definition[0].column;
|
||||||
@ -240,7 +241,6 @@ export function astToDiagram(ast) {
|
|||||||
relationship.deleteConstraint = deleteConstraint;
|
relationship.deleteConstraint = deleteConstraint;
|
||||||
relationship.cardinality = Cardinality.ONE_TO_ONE;
|
relationship.cardinality = Cardinality.ONE_TO_ONE;
|
||||||
relationships.push(relationship);
|
relationships.push(relationship);
|
||||||
console.log(relationship);
|
|
||||||
|
|
||||||
relationships.forEach((r, i) => (r.id = i));
|
relationships.forEach((r, i) => (r.id = i));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user