diff --git a/src/Core/Domain/Entity/User.php b/src/Core/Domain/Entity/User.php index 8fab6251..78cf68cd 100644 --- a/src/Core/Domain/Entity/User.php +++ b/src/Core/Domain/Entity/User.php @@ -85,13 +85,13 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface /** * @var TeamMembership[] */ - #[ORM\OneToMany(mappedBy: 'user', targetEntity: TeamMembership::class)] + #[ORM\OneToMany(mappedBy: 'user', targetEntity: TeamMembership::class, cascade: ['remove'])] private $teamMemberships; /** * @var ExecutiveBoardMembership[] */ - #[ORM\OneToMany(mappedBy: 'user', targetEntity: ExecutiveBoardMembership::class)] + #[ORM\OneToMany(mappedBy: 'user', targetEntity: ExecutiveBoardMembership::class, cascade: ['remove'])] private $executiveBoardMemberships; public function __construct()