diff --git a/packages/server/src/sdk/app/views/tests/views.spec.ts b/packages/server/src/sdk/app/views/tests/views.spec.ts index 2314f362e9..8fcc6405ef 100644 --- a/packages/server/src/sdk/app/views/tests/views.spec.ts +++ b/packages/server/src/sdk/app/views/tests/views.spec.ts @@ -1,5 +1,11 @@ import _ from "lodash" -import { FieldType, Table, TableSchema, ViewV2 } from "@budibase/types" +import { + FieldSchema, + FieldType, + Table, + TableSchema, + ViewV2, +} from "@budibase/types" import { generator } from "@budibase/backend-core/tests" import { enrichSchema, syncSchema } from ".." @@ -316,7 +322,7 @@ describe("table sdk", () => { ...basicView, } - const newTableSchema = { + const newTableSchema: TableSchema = { ...basicTable.schema, newField1: { type: FieldType.STRING, @@ -403,7 +409,7 @@ describe("table sdk", () => { }, } - const newTableSchema = { + const newTableSchema: TableSchema = { ...basicTable.schema, newField1: { type: FieldType.STRING, @@ -531,7 +537,7 @@ describe("table sdk", () => { id: { ...basicTable.schema.id, type: FieldType.NUMBER, - }, + } as FieldSchema, }, undefined ) diff --git a/packages/server/src/utilities/rowProcessor/utils.ts b/packages/server/src/utilities/rowProcessor/utils.ts index 435174b4e7..0a051a02e2 100644 --- a/packages/server/src/utilities/rowProcessor/utils.ts +++ b/packages/server/src/utilities/rowProcessor/utils.ts @@ -5,13 +5,13 @@ import { FormulaTypes, } from "../../constants" import { processStringSync } from "@budibase/string-templates" -import { AutoColumnFieldMetadata, Row, Table } from "@budibase/types" +import { FieldSchema, Row, Table } from "@budibase/types" /** * If the subtype has been lost for any reason this works out what * subtype the auto column should be. */ -export function fixAutoColumnSubType(column: AutoColumnFieldMetadata) { +export function fixAutoColumnSubType(column: FieldSchema) { if (!column.autocolumn || !column.name || column.subtype) { return column } diff --git a/packages/types/src/documents/app/table/schema.ts b/packages/types/src/documents/app/table/schema.ts index 39ec477a24..9cfd67bf80 100644 --- a/packages/types/src/documents/app/table/schema.ts +++ b/packages/types/src/documents/app/table/schema.ts @@ -121,7 +121,7 @@ interface BaseFieldSchema extends UIFieldMetadata { subtype?: string } -export interface OtherFieldMetadata extends BaseFieldSchema { +interface OtherFieldMetadata extends BaseFieldSchema { type: Exclude< FieldType, | FieldType.DATETIME