Fix standardId issues with phones field migration (#7294)

Co-authored-by: Weiko <corentin@twenty.com>
This commit is contained in:
Marie
2024-09-27 16:52:06 +02:00
committed by GitHub
parent 9f477129e2
commit e28d8dd952
2 changed files with 11 additions and 1 deletions

View File

@ -168,6 +168,16 @@ export class MigratePhoneFieldsToPhonesCommand extends ActiveWorkspacesCommandRu
name: 'phones',
} satisfies CreateFieldInput);
// StandardId and isCustom are not exposed in CreateFieldInput
await this.metadataDataSource.query(
`UPDATE "metadata"."fieldMetadata" SET "standardId" = $1, "isCustom" = $2 where "id"=$3`,
[
PERSON_STANDARD_FIELD_IDS.phones,
'false',
standardPersonPhonesField.id,
],
);
await this.viewService.removeFieldFromViews({
workspaceId: workspaceId,
fieldId: standardPersonPhonesField.id,