Update workspace entities to make all TEXT nullable (#16144)

Follow up on #15926

---------

Co-authored-by: Etienne <45695613+etiennejouan@users.noreply.github.com>
Co-authored-by: guillim <guigloo@msn.com>
This commit is contained in:
Charles Bochet
2025-11-28 10:50:38 +01:00
committed by GitHub
parent 9620a4b0ba
commit eb362c6d5f
63 changed files with 396 additions and 136 deletions
@@ -1,6 +1,6 @@
import { msg } from '@lingui/core/macro';
import { FieldMetadataType, RelationOnDeleteAction } from 'twenty-shared/types';
import { STANDARD_OBJECT_IDS } from 'twenty-shared/metadata';
import { FieldMetadataType, RelationOnDeleteAction } from 'twenty-shared/types';
import { RelationType } from 'src/engine/metadata-modules/field-metadata/interfaces/relation-type.interface';
import { Relation } from 'src/engine/workspace-manager/workspace-sync-metadata/interfaces/relation.interface';
@@ -9,6 +9,7 @@ import { BaseWorkspaceEntity } from 'src/engine/twenty-orm/base.workspace-entity
import { WorkspaceEntity } from 'src/engine/twenty-orm/decorators/workspace-entity.decorator';
import { WorkspaceField } from 'src/engine/twenty-orm/decorators/workspace-field.decorator';
import { WorkspaceIsNotAuditLogged } from 'src/engine/twenty-orm/decorators/workspace-is-not-audit-logged.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 { WorkspaceJoinColumn } from 'src/engine/twenty-orm/decorators/workspace-join-column.decorator';
import { WorkspaceRelation } from 'src/engine/twenty-orm/decorators/workspace-relation.decorator';
@@ -42,7 +43,8 @@ export class CalendarChannelEventAssociationWorkspaceEntity extends BaseWorkspac
description: msg`Event external ID`,
icon: 'IconCalendar',
})
eventExternalId: string;
@WorkspaceIsNullable()
eventExternalId: string | null;
@WorkspaceField({
standardId:
@@ -52,7 +54,8 @@ export class CalendarChannelEventAssociationWorkspaceEntity extends BaseWorkspac
description: msg`Recurring Event ID`,
icon: 'IconHistory',
})
recurringEventExternalId: string;
@WorkspaceIsNullable()
recurringEventExternalId: string | null;
@WorkspaceRelation({
standardId:
@@ -1,8 +1,8 @@
import { registerEnumType } from '@nestjs/graphql';
import { msg } from '@lingui/core/macro';
import { FieldMetadataType, RelationOnDeleteAction } from 'twenty-shared/types';
import { STANDARD_OBJECT_IDS } from 'twenty-shared/metadata';
import { FieldMetadataType, RelationOnDeleteAction } from 'twenty-shared/types';
import { RelationType } from 'src/engine/metadata-modules/field-metadata/interfaces/relation-type.interface';
import { Relation } from 'src/engine/workspace-manager/workspace-sync-metadata/interfaces/relation.interface';
@@ -87,7 +87,8 @@ export class CalendarChannelWorkspaceEntity extends BaseWorkspaceEntity {
description: msg`Handle`,
icon: 'IconAt',
})
handle: string;
@WorkspaceIsNullable()
handle: string | null;
@WorkspaceField({
standardId: CALENDAR_CHANNEL_STANDARD_FIELD_IDS.syncStatus,
@@ -280,7 +281,8 @@ export class CalendarChannelWorkspaceEntity extends BaseWorkspaceEntity {
description: msg`Sync Cursor. Used for syncing events from the calendar provider`,
icon: 'IconReload',
})
syncCursor: string;
@WorkspaceIsNullable()
syncCursor: string | null;
@WorkspaceField({
standardId: CALENDAR_CHANNEL_STANDARD_FIELD_IDS.syncedAt,
@@ -1,6 +1,6 @@
import { msg } from '@lingui/core/macro';
import { FieldMetadataType, RelationOnDeleteAction } from 'twenty-shared/types';
import { STANDARD_OBJECT_IDS } from 'twenty-shared/metadata';
import { FieldMetadataType, RelationOnDeleteAction } from 'twenty-shared/types';
import { RelationType } from 'src/engine/metadata-modules/field-metadata/interfaces/relation-type.interface';
import { Relation } from 'src/engine/workspace-manager/workspace-sync-metadata/interfaces/relation.interface';
@@ -47,7 +47,8 @@ export class CalendarEventParticipantWorkspaceEntity extends BaseWorkspaceEntity
description: msg`Handle`,
icon: 'IconMail',
})
handle: string;
@WorkspaceIsNullable()
handle: string | null;
@WorkspaceField({
standardId: CALENDAR_EVENT_PARTICIPANT_STANDARD_FIELD_IDS.displayName,
@@ -56,7 +57,8 @@ export class CalendarEventParticipantWorkspaceEntity extends BaseWorkspaceEntity
description: msg`Display Name`,
icon: 'IconUser',
})
displayName: string;
@WorkspaceIsNullable()
displayName: string | null;
@WorkspaceField({
standardId: CALENDAR_EVENT_PARTICIPANT_STANDARD_FIELD_IDS.isOrganizer,
@@ -1,10 +1,10 @@
import { msg } from '@lingui/core/macro';
import { STANDARD_OBJECT_IDS } from 'twenty-shared/metadata';
import {
FieldMetadataType,
RelationOnDeleteAction,
LinksMetadata,
RelationOnDeleteAction,
} from 'twenty-shared/types';
import { STANDARD_OBJECT_IDS } from 'twenty-shared/metadata';
import { RelationType } from 'src/engine/metadata-modules/field-metadata/interfaces/relation-type.interface';
import { Relation } from 'src/engine/workspace-manager/workspace-sync-metadata/interfaces/relation.interface';
@@ -43,7 +43,8 @@ export class CalendarEventWorkspaceEntity extends BaseWorkspaceEntity {
description: msg`Title`,
icon: 'IconH1',
})
title: string;
@WorkspaceIsNullable()
title: string | null;
@WorkspaceField({
standardId: CALENDAR_EVENT_STANDARD_FIELD_IDS.isCanceled,
@@ -112,7 +113,8 @@ export class CalendarEventWorkspaceEntity extends BaseWorkspaceEntity {
description: msg`Description`,
icon: 'IconFileDescription',
})
description: string;
@WorkspaceIsNullable()
description: string | null;
@WorkspaceField({
standardId: CALENDAR_EVENT_STANDARD_FIELD_IDS.location,
@@ -121,7 +123,8 @@ export class CalendarEventWorkspaceEntity extends BaseWorkspaceEntity {
description: msg`Location`,
icon: 'IconMapPin',
})
location: string;
@WorkspaceIsNullable()
location: string | null;
@WorkspaceField({
standardId: CALENDAR_EVENT_STANDARD_FIELD_IDS.iCalUID,
@@ -130,7 +133,8 @@ export class CalendarEventWorkspaceEntity extends BaseWorkspaceEntity {
description: msg`iCal UID`,
icon: 'IconKey',
})
iCalUID: string;
@WorkspaceIsNullable()
iCalUID: string | null;
@WorkspaceField({
standardId: CALENDAR_EVENT_STANDARD_FIELD_IDS.conferenceSolution,
@@ -139,7 +143,8 @@ export class CalendarEventWorkspaceEntity extends BaseWorkspaceEntity {
description: msg`Conference Solution`,
icon: 'IconScreenShare',
})
conferenceSolution: string;
@WorkspaceIsNullable()
conferenceSolution: string | null;
@WorkspaceField({
standardId: CALENDAR_EVENT_STANDARD_FIELD_IDS.conferenceLink,