From e932aa105beaf6e0546ddec09c8c2b9ed85f9637 Mon Sep 17 00:00:00 2001 From: Dean Date: Thu, 17 Nov 2022 16:28:48 +0000 Subject: [PATCH] Shifted the budibase datasource constant to backend-core --- packages/backend-core/src/constants.js | 1 + packages/server/src/api/controllers/datasource.js | 7 ++----- packages/server/src/constants/index.js | 2 -- .../server/src/db/defaultData/datasource_bb_default.js | 2 +- packages/server/src/db/utils.js | 2 +- 5 files changed, 5 insertions(+), 9 deletions(-) diff --git a/packages/backend-core/src/constants.js b/packages/backend-core/src/constants.js index 44c271a4f8..51c8dcffca 100644 --- a/packages/backend-core/src/constants.js +++ b/packages/backend-core/src/constants.js @@ -42,3 +42,4 @@ exports.Configs = { exports.MAX_VALID_DATE = new Date(2147483647000) exports.DEFAULT_TENANT_ID = "default" +exports.BUDIBASE_DATASOURCE_TYPE = "budibase" diff --git a/packages/server/src/api/controllers/datasource.js b/packages/server/src/api/controllers/datasource.js index c6d2cbcbb6..1bcfb3c423 100644 --- a/packages/server/src/api/controllers/datasource.js +++ b/packages/server/src/api/controllers/datasource.js @@ -7,16 +7,13 @@ const { getTableParams, } = require("../../db/utils") const { destroy: tableDestroy } = require("./table/internal") -const { - BuildSchemaErrors, - InvalidColumns, - BUDIBASE_DATASOURCE_TYPE, -} = require("../../constants") +const { BuildSchemaErrors, InvalidColumns } = require("../../constants") const { getIntegration } = require("../../integrations") const { getDatasourceAndQuery } = require("./row/utils") const { invalidateDynamicVariables } = require("../../threads/utils") const { getAppDB } = require("@budibase/backend-core/context") const { events } = require("@budibase/backend-core") +const { BUDIBASE_DATASOURCE_TYPE } = require("@budibase/backend-core/constants") exports.fetch = async function (ctx) { // Get internal tables diff --git a/packages/server/src/constants/index.js b/packages/server/src/constants/index.js index 588a4a730b..6d8fe57baa 100644 --- a/packages/server/src/constants/index.js +++ b/packages/server/src/constants/index.js @@ -89,8 +89,6 @@ exports.DatasourceAuthTypes = { GOOGLE: "google", } -exports.BUDIBASE_DATASOURCE_TYPE = "budibase" - exports.SortDirection = { ASCENDING: "ASCENDING", DESCENDING: "DESCENDING", diff --git a/packages/server/src/db/defaultData/datasource_bb_default.js b/packages/server/src/db/defaultData/datasource_bb_default.js index 2cfb68a67b..13394eebd2 100644 --- a/packages/server/src/db/defaultData/datasource_bb_default.js +++ b/packages/server/src/db/defaultData/datasource_bb_default.js @@ -10,7 +10,7 @@ const { inventoryImport } = require("./inventoryImport") const { employeeImport } = require("./employeeImport") const { jobsImport } = require("./jobsImport") const { expensesImport } = require("./expensesImport") -const { BUDIBASE_DATASOURCE_TYPE } = require("../../constants") +const { BUDIBASE_DATASOURCE_TYPE } = require("@budibase/backend-core/constants") exports.DEFAULT_JOBS_TABLE_ID = "ta_bb_jobs" exports.DEFAULT_INVENTORY_TABLE_ID = "ta_bb_inventory" diff --git a/packages/server/src/db/utils.js b/packages/server/src/db/utils.js index 8b631c1a05..a74ea0c217 100644 --- a/packages/server/src/db/utils.js +++ b/packages/server/src/db/utils.js @@ -22,7 +22,7 @@ const { getGlobalIDFromUserMetadataID, } = require("@budibase/backend-core/db") -const { BUDIBASE_DATASOURCE_TYPE } = require("../constants") +const { BUDIBASE_DATASOURCE_TYPE } = require("@budibase/backend-core/constants") const UNICODE_MAX = "\ufff0"