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,

View File

@@ -310,7 +310,7 @@ export const PERSON_STANDARD_FIELD_IDS = {
xLink: '20202020-8fc2-487c-b84a-55a99b145cfd',
jobTitle: '20202020-b0d0-415a-bef9-640a26dacd9b',
phone: '20202020-4564-4b8b-a09f-05445f2e0bce',
phones: '34becd3e-3c51-43fa-8b6e-af39e29368ab',
phones: '20202020-0638-448e-8825-439134618022',
city: '20202020-5243-4ffb-afc5-2c675da41346',
avatarUrl: '20202020-b8a6-40df-961c-373dc5d2ec21',
position: '20202020-fcd5-4231-aff5-fff583eaa0b1',