1
0
Fork 0
mirror of synced 2024-09-12 23:43:09 +12:00
This commit is contained in:
Adria Navarro 2024-04-26 13:26:14 +02:00
parent 2bdbc69832
commit 2be14deb01
2 changed files with 24 additions and 15 deletions

View file

@ -16,6 +16,7 @@ import {
SourceName,
Table,
TableSchema,
SupportedSqlTypes,
} from "@budibase/types"
import { DatabaseName, getDatasource } from "../../../integrations/tests/utils"
import { tableForDatasource } from "../../../tests/utilities/structures"
@ -261,20 +262,6 @@ describe("/datasources", () => {
})
)
type SupportedSqlTypes =
| FieldType.STRING
| FieldType.BARCODEQR
| FieldType.LONGFORM
| FieldType.OPTIONS
| FieldType.DATETIME
| FieldType.NUMBER
| FieldType.BOOLEAN
| FieldType.FORMULA
| FieldType.BIGINT
| FieldType.BB_REFERENCE
| FieldType.LINK
| FieldType.ARRAY
const fullSchema: {
[type in SupportedSqlTypes]: FieldSchema & { type: type }
} = {
@ -337,7 +324,12 @@ describe("/datasources", () => {
[FieldType.BB_REFERENCE]: {
name: "bb_reference",
type: FieldType.BB_REFERENCE,
subtype: BBReferenceFieldSubType.USERS,
subtype: BBReferenceFieldSubType.USER,
},
[FieldType.BB_REFERENCE_SINGLE]: {
name: "bb_reference_single",
type: FieldType.BB_REFERENCE_SINGLE,
subtype: BBReferenceFieldSubType.USER,
},
}

View file

@ -1,3 +1,5 @@
import { FieldType } from "../row"
export enum RelationshipType {
ONE_TO_MANY = "one-to-many",
MANY_TO_ONE = "many-to-one",
@ -30,3 +32,18 @@ export enum BBReferenceFieldSubType {
/** @deprecated this should not be used anymore, left here in order to support the existing usages */
USERS = "users",
}
export type SupportedSqlTypes =
| FieldType.STRING
| FieldType.BARCODEQR
| FieldType.LONGFORM
| FieldType.OPTIONS
| FieldType.DATETIME
| FieldType.NUMBER
| FieldType.BOOLEAN
| FieldType.FORMULA
| FieldType.BIGINT
| FieldType.BB_REFERENCE
| FieldType.BB_REFERENCE_SINGLE
| FieldType.LINK
| FieldType.ARRAY