Making sure all JSON column types are correctly handled.
This commit is contained in:
parent
0c28d05d40
commit
66686fd970
|
@ -20,6 +20,7 @@ import {
|
||||||
INTERNAL_TABLE_SOURCE_ID,
|
INTERNAL_TABLE_SOURCE_ID,
|
||||||
SqlClient,
|
SqlClient,
|
||||||
QueryOptions,
|
QueryOptions,
|
||||||
|
JsonTypes,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
import environment from "../environment"
|
import environment from "../environment"
|
||||||
import { helpers } from "@budibase/shared-core"
|
import { helpers } from "@budibase/shared-core"
|
||||||
|
@ -796,9 +797,8 @@ class SqlQueryBuilder extends SqlTableQueryBuilder {
|
||||||
field: FieldSchema
|
field: FieldSchema
|
||||||
): field is JsonFieldMetadata | BBReferenceFieldMetadata {
|
): field is JsonFieldMetadata | BBReferenceFieldMetadata {
|
||||||
return (
|
return (
|
||||||
field.type === FieldType.JSON ||
|
JsonTypes.includes(field.type) &&
|
||||||
(field.type === FieldType.BB_REFERENCE &&
|
!helpers.schema.isDeprecatedSingleUserColumn(field)
|
||||||
!helpers.schema.isDeprecatedSingleUserColumn(field))
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -118,6 +118,15 @@ export enum FieldType {
|
||||||
BB_REFERENCE_SINGLE = "bb_reference_single",
|
BB_REFERENCE_SINGLE = "bb_reference_single",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const JsonTypes = [
|
||||||
|
FieldType.ATTACHMENT_SINGLE,
|
||||||
|
FieldType.BB_REFERENCE_SINGLE,
|
||||||
|
FieldType.ATTACHMENTS,
|
||||||
|
FieldType.BB_REFERENCE,
|
||||||
|
FieldType.JSON,
|
||||||
|
FieldType.ARRAY,
|
||||||
|
]
|
||||||
|
|
||||||
export interface RowAttachment {
|
export interface RowAttachment {
|
||||||
size: number
|
size: number
|
||||||
name: string
|
name: string
|
||||||
|
|
Loading…
Reference in New Issue