From b9cf0b565b83c5d9f810b2e7992558b9b7176b64 Mon Sep 17 00:00:00 2001 From: Marie Stoppa Date: Wed, 10 Jul 2024 11:50:43 +0200 Subject: [PATCH] Skip workspace instead of throwing error if datasourceMetadata is missing --- ...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