1
0
Fork 0
mirror of synced 2024-06-01 18:20:18 +12:00
This commit is contained in:
Mel O'Hagan 2022-09-23 16:54:39 +01:00
parent f492a40edd
commit 9a8b054b19

View file

@ -90,16 +90,13 @@
if (inSchema(toTable, toRelate.name, originalToName)) {
errObj.toCol = colError
}
if (
fromPrimary &&
fromRelate.fieldName &&
plusTables.filter(table => table.name === fromTable?.name)[0]?.schema[
fromPrimary
]?.type !==
plusTables.filter(table => table.name === toTable?.name)[0]?.schema[
fromRelate.fieldName
]?.type
) {
let fromType, toType
if (fromPrimary && fromRelate.fieldName) {
fromType = fromTable?.schema[fromPrimary]?.type
toType = toTable?.schema[fromRelate.fieldName]?.type
}
if (fromType && toType && fromType !== toType) {
errObj.foreign =
"Column type of the foreign key must match the primary key"
}