From ef251f812983a8bb198c4f3d6a1a4582b2452ba6 Mon Sep 17 00:00:00 2001 From: Weiko Date: Fri, 14 Mar 2025 18:49:31 +0100 Subject: [PATCH] Set attachment authorId nullable (#10908) ## Context This should fix workspaceMember deletion when attachments exist. Attachment should still be available even if its author leaves the workspace. Currently the author is never displayed in the product. Screenshot 2025-03-14 at 18 46 49 Screenshot 2025-03-14 at 18 46 25 --- .../standard-objects/attachment.workspace-entity.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/twenty-server/src/modules/attachment/standard-objects/attachment.workspace-entity.ts b/packages/twenty-server/src/modules/attachment/standard-objects/attachment.workspace-entity.ts index aa0f9f661..6c5577391 100644 --- a/packages/twenty-server/src/modules/attachment/standard-objects/attachment.workspace-entity.ts +++ b/packages/twenty-server/src/modules/attachment/standard-objects/attachment.workspace-entity.ts @@ -72,10 +72,11 @@ export class AttachmentWorkspaceEntity extends BaseWorkspaceEntity { inverseSideTarget: () => WorkspaceMemberWorkspaceEntity, inverseSideFieldKey: 'authoredAttachments', }) - author: Relation; + @WorkspaceIsNullable() + author: Relation | null; @WorkspaceJoinColumn('author') - authorId: string; + authorId: string | null; @WorkspaceRelation({ standardId: ATTACHMENT_STANDARD_FIELD_IDS.task,