From 02e5c5ea9744a424104535c58adb093e205b27b4 Mon Sep 17 00:00:00 2001 From: Marie <51697796+ijreilly@users.noreply.github.com> Date: Wed, 10 Jul 2024 11:56:30 +0200 Subject: [PATCH] Update boolean field command to skip workspace instead of throwing (#6196) as per title --- ...an-fields-null-default-values-and-null-values.command.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/twenty-server/src/database/commands/upgrade-version/0-22/0-22-update-boolean-fields-null-default-values-and-null-values.command.ts b/packages/twenty-server/src/database/commands/upgrade-version/0-22/0-22-update-boolean-fields-null-default-values-and-null-values.command.ts index 1bbcef9caa40..b001e7c5e233 100644 --- a/packages/twenty-server/src/database/commands/upgrade-version/0-22/0-22-update-boolean-fields-null-default-values-and-null-values.command.ts +++ b/packages/twenty-server/src/database/commands/upgrade-version/0-22/0-22-update-boolean-fields-null-default-values-and-null-values.command.ts @@ -76,9 +76,10 @@ export class UpdateBooleanFieldsNullDefaultValuesAndNullValuesCommand extends Co ); if (!dataSourceMetadata) { - throw new Error( + this.logger.log( `Could not find dataSourceMetadata for workspace ${workspaceId}`, ); + continue; } const workspaceDataSource = @@ -115,9 +116,10 @@ export class UpdateBooleanFieldsNullDefaultValuesAndNullValuesCommand extends Co for (const booleanField of booleanFieldsWithoutDefaultValue) { if (!booleanField.object) { - throw new Error( + this.logger.log( `Could not find objectMetadataItem for field ${booleanField.id}`, ); + continue; } // Could be done via a batch update but it's safer in this context to run it sequentially with the ALTER TABLE