Fix are fields compatible (#484)

This commit is contained in:
Karen Mkrtumyan
2025-06-08 14:25:01 +04:00
committed by GitHub
parent 14ee753d47
commit 34a9b5f297

View File

@@ -43,14 +43,12 @@ export function isFunction(str) {
return /\w+\([^)]*\)$/.test(str); return /\w+\([^)]*\)$/.test(str);
} }
export function areFieldsCompatible(db, field1, field2) { export function areFieldsCompatible(db, field1Type, field2Type) {
const same = field1.type === field2.type; const same = field1Type === field2Type;
if (dbToTypes[db][field1.type].compatibleWith) { const isCompatible =
return ( dbToTypes[db][field1Type].compatibleWith &&
dbToTypes[db][field1.type].compatibleWith.includes(field2.type) || same dbToTypes[db][field1Type].compatibleWith.includes(field2Type);
); return same || isCompatible;
}
return same;
} }
export function getTableHeight(table) { export function getTableHeight(table) {