From c34cd470ee34ac9537bc8f093de24e7beb9c45b9 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 19 Apr 2024 11:05:36 +0200 Subject: [PATCH] Fix dropping columns existing only internally --- packages/server/src/integrations/utils/utils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/server/src/integrations/utils/utils.ts b/packages/server/src/integrations/utils/utils.ts index cc75f0444d..ba8d288a55 100644 --- a/packages/server/src/integrations/utils/utils.ts +++ b/packages/server/src/integrations/utils/utils.ts @@ -353,6 +353,7 @@ function copyExistingPropsOver( // If the db column type changed to a non-compatible one, we want to re-fetch it if ( + updatedColumnType && updatedColumnType !== existingColumnType && !SWITCHABLE_TYPES[updatedColumnType]?.includes(existingColumnType) ) { @@ -384,7 +385,7 @@ function copyExistingPropsOver( ...existingTableSchema[key], externalType: existingTableSchema[key].externalType || - table.schema[key].externalType, + table.schema[key]?.externalType, } } }