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,10 +1,10 @@
import { msg } from '@lingui/core/macro';
import { STANDARD_OBJECT_IDS } from 'twenty-shared/metadata';
import {
ConnectedAccountProvider,
FieldMetadataType,
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';
@@ -42,7 +42,8 @@ export class ConnectedAccountWorkspaceEntity extends BaseWorkspaceEntity {
description: msg`The account handle (email, username, phone number, etc.)`,
icon: 'IconMail',
})
handle: string;
@WorkspaceIsNullable()
handle: string | null;
@WorkspaceField({
standardId: CONNECTED_ACCOUNT_STANDARD_FIELD_IDS.provider,
@@ -50,6 +51,7 @@ export class ConnectedAccountWorkspaceEntity extends BaseWorkspaceEntity {
label: msg`provider`,
description: msg`The account provider`,
icon: 'IconSettings',
defaultValue: `'${ConnectedAccountProvider.GOOGLE}'`,
})
provider: ConnectedAccountProvider; // field metadata should be a SELECT
@@ -60,7 +62,8 @@ export class ConnectedAccountWorkspaceEntity extends BaseWorkspaceEntity {
description: msg`Messaging provider access token`,
icon: 'IconKey',
})
accessToken: string;
@WorkspaceIsNullable()
accessToken: string | null;
@WorkspaceField({
standardId: CONNECTED_ACCOUNT_STANDARD_FIELD_IDS.refreshToken,
@@ -69,7 +72,8 @@ export class ConnectedAccountWorkspaceEntity extends BaseWorkspaceEntity {
description: msg`Messaging provider refresh token`,
icon: 'IconKey',
})
refreshToken: string;
@WorkspaceIsNullable()
refreshToken: string | null;
@WorkspaceField({
standardId: CONNECTED_ACCOUNT_STANDARD_FIELD_IDS.lastCredentialsRefreshedAt,
@@ -88,7 +92,8 @@ export class ConnectedAccountWorkspaceEntity extends BaseWorkspaceEntity {
description: msg`Last sync history ID`,
icon: 'IconHistory',
})
lastSyncHistoryId: string;
@WorkspaceIsNullable()
lastSyncHistoryId: string | null;
@WorkspaceField({
standardId: CONNECTED_ACCOUNT_STANDARD_FIELD_IDS.authFailedAt,
@@ -107,7 +112,8 @@ export class ConnectedAccountWorkspaceEntity extends BaseWorkspaceEntity {
description: msg`Handle Aliases`,
icon: 'IconMail',
})
handleAliases: string;
@WorkspaceIsNullable()
handleAliases: string | null;
@WorkspaceField({
standardId: CONNECTED_ACCOUNT_STANDARD_FIELD_IDS.scopes,