Skip to content

The open alternative to Salesforce, designed for AI.

[Phones migration][Fix] Remove field from view after creation (#7243)

Marieb3a0cba9614b
diff --git a/packages/twenty-server/src/database/commands/upgrade-version/0-32/0-32-migrate-phone-fields-to-phones.command.ts b/packages/twenty-server/src/database/commands/upgrade-version/0-32/0-32-migrate-phone-fields-to-phones.command.ts
index dc7f56e204c..115074cb161 100644
--- a/packages/twenty-server/src/database/commands/upgrade-version/0-32/0-32-migrate-phone-fields-to-phones.command.ts
+++ b/packages/twenty-server/src/database/commands/upgrade-version/0-32/0-32-migrate-phone-fields-to-phones.command.ts
@@ -168,6 +168,11 @@ export class MigratePhoneFieldsToPhonesCommand extends ActiveWorkspacesCommandRu
defaultValue: null,
name: 'phones',
} satisfies CreateFieldInput);
+
+ await this.viewService.removeFieldFromViews({
+ workspaceId: workspaceId,
+ fieldId: standardPersonPhonesFieldType.id,
+ });
}
// Copy phone data from Text type to Phones type