Fix missing on delete cascade for relation (#11725)

Follow up from https://github.com/twentyhq/twenty/pull/10217
Adding onDelete action on Many_to_one sides
This commit is contained in:
martmull
2025-04-24 18:32:14 +02:00
committed by GitHub
parent c0df96b383
commit 4d7dbb1991
19 changed files with 71 additions and 0 deletions

View File

@ -185,6 +185,7 @@ export class PersonWorkspaceEntity extends BaseWorkspaceEntity {
icon: 'IconBuildingSkyscraper',
inverseSideTarget: () => CompanyWorkspaceEntity,
inverseSideFieldKey: 'people',
onDelete: RelationOnDeleteAction.SET_NULL,
})
@WorkspaceIsNullable()
company: Relation<CompanyWorkspaceEntity> | null;