From 28a10bf908f7bf20c81b8f93d14c6fd337ea1e18 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Fri, 9 Aug 2024 14:54:47 +0100 Subject: [PATCH] Another test fix (yay for this one) --- packages/server/src/integrations/utils/utils.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/server/src/integrations/utils/utils.ts b/packages/server/src/integrations/utils/utils.ts index 6d0e4b838f..43302de36f 100644 --- a/packages/server/src/integrations/utils/utils.ts +++ b/packages/server/src/integrations/utils/utils.ts @@ -15,7 +15,7 @@ import { helpers, utils } from "@budibase/shared-core" import { pipeline } from "stream/promises" import tmp from "tmp" import fs from "fs" -import { merge } from "lodash" +import { merge, cloneDeep } from "lodash" type PrimitiveTypes = | FieldType.STRING @@ -293,7 +293,11 @@ function copyExistingPropsOver( table.schema[key] table.schema[key] = { // merge the properties - anything missing will be filled in, old definition preferred - ...merge(fetchedColumnDefinition, existingTableSchema[key]), + // have to clone due to the way merge works + ...merge( + cloneDeep(fetchedColumnDefinition), + existingTableSchema[key] + ), // always take externalType and autocolumn from the fetched definition externalType: existingTableSchema[key].externalType ||