budibase/packages/shared-core/src/helpers/schema.ts

16 lines
381 B
TypeScript
Raw Normal View History

2024-05-09 12:28:44 +02:00
import {
BBReferenceFieldSubType,
FieldSchema,
FieldType,
} from "@budibase/types"
2024-05-13 12:13:57 +02:00
export function isDeprecatedSingleUserColumn(
schema: Pick<FieldSchema, "type" | "subtype" | "constraints">
) {
2024-05-09 12:28:44 +02:00
const result =
schema.type === FieldType.BB_REFERENCE &&
schema.subtype === BBReferenceFieldSubType.USER &&
schema.constraints?.type !== "array"
return result
}