Fix mappings
This commit is contained in:
parent
fbc969eda4
commit
aabed795ec
|
@ -108,6 +108,11 @@ export function fixArrayTypes(row: Row, table: Table) {
|
||||||
[FieldType.ARRAY, FieldType.BB_REFERENCE].includes(schema.type) &&
|
[FieldType.ARRAY, FieldType.BB_REFERENCE].includes(schema.type) &&
|
||||||
typeof row[fieldName] === "string"
|
typeof row[fieldName] === "string"
|
||||||
) {
|
) {
|
||||||
|
// Handling old single user type
|
||||||
|
if (schema.constraints?.type !== "array") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
row[fieldName] = JSON.parse(row[fieldName])
|
row[fieldName] = JSON.parse(row[fieldName])
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
|
@ -764,7 +764,10 @@ class SqlQueryBuilder extends SqlTableQueryBuilder {
|
||||||
field: FieldSchema
|
field: FieldSchema
|
||||||
): field is JsonFieldMetadata | BBReferenceFieldMetadata {
|
): field is JsonFieldMetadata | BBReferenceFieldMetadata {
|
||||||
return (
|
return (
|
||||||
field.type === FieldType.JSON || field.type === FieldType.BB_REFERENCE
|
field.type === FieldType.JSON ||
|
||||||
|
(field.type === FieldType.BB_REFERENCE &&
|
||||||
|
// Handling old single user type
|
||||||
|
field.constraints?.type === "array")
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue