Fix types

This commit is contained in:
Adria Navarro 2023-01-20 09:58:59 +00:00
parent 5fb20abcfd
commit 7f53cbeca7
5 changed files with 9 additions and 16 deletions

View File

@ -10,6 +10,7 @@ import {
FieldSchema,
Row,
Table,
RelationshipTypes,
} from "@budibase/types"
import {
breakRowIdField,
@ -18,7 +19,7 @@ import {
convertRowId,
} from "../../../integrations/utils"
import { getDatasourceAndQuery } from "./utils"
import { FieldTypes, RelationshipTypes } from "../../../constants"
import { FieldTypes } from "../../../constants"
import { breakExternalTableId, isSQL } from "../../../integrations/utils"
import { processObjectSync } from "@budibase/string-templates"
import { cloneDeep } from "lodash/fp"

View File

@ -8,7 +8,7 @@ import {
foreignKeyStructure,
hasTypeChanged,
} from "./utils"
import { FieldTypes, RelationshipTypes } from "../../../constants"
import { FieldTypes } from "../../../constants"
import { makeExternalQuery } from "../../../integrations/base/query"
import { handleRequest } from "../row/external"
import { events, context } from "@budibase/backend-core"
@ -22,6 +22,7 @@ import {
FieldSchema,
BBContext,
TableRequest,
RelationshipTypes,
} from "@budibase/types"
import sdk from "../../../sdk"
const { cloneDeep } = require("lodash/fp")
@ -146,7 +147,7 @@ function generateLinkSchema(
column: FieldSchema,
table: Table,
relatedTable: Table,
type: string
type: RelationshipTypes
) {
if (!table.primary || !relatedTable.primary) {
throw new Error("Unable to generate link schema, no primary keys")

View File

@ -38,12 +38,6 @@ export const SwitchableTypes = CanSwitchTypes.reduce((prev, current) =>
prev ? prev.concat(current) : current
)
export enum RelationshipTypes {
ONE_TO_MANY = "one-to-many",
MANY_TO_ONE = "many-to-one",
MANY_TO_MANY = "many-to-many",
}
export enum FormulaTypes {
STATIC = "static",
DYNAMIC = "dynamic",

View File

@ -1,8 +1,4 @@
import {
FieldTypes,
AutoFieldSubTypes,
RelationshipTypes,
} from "../../constants"
import { FieldTypes, AutoFieldSubTypes } from "../../constants"
import { importToRows } from "../../api/controllers/table/utils"
import { cloneDeep } from "lodash/fp"
import LinkDocument from "../linkedRows/LinkDocument"
@ -11,7 +7,7 @@ import { employeeImport } from "./employeeImport"
import { jobsImport } from "./jobsImport"
import { expensesImport } from "./expensesImport"
import { db as dbCore } from "@budibase/backend-core"
import { Table, Row } from "@budibase/types"
import { Table, Row, RelationshipTypes } from "@budibase/types"
export const DEFAULT_JOBS_TABLE_ID = "ta_bb_jobs"
export const DEFAULT_INVENTORY_TABLE_ID = "ta_bb_inventory"

View File

@ -1,13 +1,14 @@
import { IncludeDocs, getLinkDocuments } from "./linkUtils"
import { InternalTables, getUserMetadataParams } from "../utils"
import Sentry from "@sentry/node"
import { FieldTypes, RelationshipTypes } from "../../constants"
import { FieldTypes } from "../../constants"
import { context } from "@budibase/backend-core"
import LinkDocument from "./LinkDocument"
import {
Database,
FieldSchema,
LinkDocumentValue,
RelationshipTypes,
Row,
Table,
} from "@budibase/types"