Fix upgrade-0-42 command to migrate RICH_TEXT field metadata to RICH_TEXT_V2 (#10218)

While making sure the upgrade-0.42 command was working as expected to
upgrade from 0.41 to 0.42, we've detected that the standardId of the new
bodyV2 (type RICH_TEXT_V2) was not properly set ; standardId was not
correct.

This was forcing the sync-metadata command to try to re-create the field
again.
This commit is contained in:
Charles Bochet
2025-02-14 13:50:06 +01:00
committed by GitHub
parent a36ba02efe
commit 258025a18f
5 changed files with 31 additions and 6 deletions

View File

@ -17,6 +17,7 @@ import { WorkspaceEntity } from 'src/engine/twenty-orm/decorators/workspace-enti
import { WorkspaceFieldIndex } from 'src/engine/twenty-orm/decorators/workspace-field-index.decorator';
import { WorkspaceField } from 'src/engine/twenty-orm/decorators/workspace-field.decorator';
import { WorkspaceGate } from 'src/engine/twenty-orm/decorators/workspace-gate.decorator';
import { WorkspaceIsDeprecated } from 'src/engine/twenty-orm/decorators/workspace-is-deprecated.decorator';
import { WorkspaceIsNullable } from 'src/engine/twenty-orm/decorators/workspace-is-nullable.decorator';
import { WorkspaceIsSystem } from 'src/engine/twenty-orm/decorators/workspace-is-system.decorator';
import { WorkspaceRelation } from 'src/engine/twenty-orm/decorators/workspace-relation.decorator';
@ -72,10 +73,11 @@ export class NoteWorkspaceEntity extends BaseWorkspaceEntity {
@WorkspaceField({
standardId: NOTE_STANDARD_FIELD_IDS.body,
type: FieldMetadataType.RICH_TEXT,
label: msg`Body`,
label: msg`Body (deprecated)`,
description: msg`Note body`,
icon: 'IconFilePencil',
})
@WorkspaceIsDeprecated()
@WorkspaceIsNullable()
body: string | null;