Refactor
This commit is contained in:
parent
f492a40edd
commit
9a8b054b19
|
@ -90,16 +90,13 @@
|
||||||
if (inSchema(toTable, toRelate.name, originalToName)) {
|
if (inSchema(toTable, toRelate.name, originalToName)) {
|
||||||
errObj.toCol = colError
|
errObj.toCol = colError
|
||||||
}
|
}
|
||||||
if (
|
|
||||||
fromPrimary &&
|
let fromType, toType
|
||||||
fromRelate.fieldName &&
|
if (fromPrimary && fromRelate.fieldName) {
|
||||||
plusTables.filter(table => table.name === fromTable?.name)[0]?.schema[
|
fromType = fromTable?.schema[fromPrimary]?.type
|
||||||
fromPrimary
|
toType = toTable?.schema[fromRelate.fieldName]?.type
|
||||||
]?.type !==
|
}
|
||||||
plusTables.filter(table => table.name === toTable?.name)[0]?.schema[
|
if (fromType && toType && fromType !== toType) {
|
||||||
fromRelate.fieldName
|
|
||||||
]?.type
|
|
||||||
) {
|
|
||||||
errObj.foreign =
|
errObj.foreign =
|
||||||
"Column type of the foreign key must match the primary key"
|
"Column type of the foreign key must match the primary key"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue