From 7f2efdb07360baaae629d5d37387e6782a42494a Mon Sep 17 00:00:00 2001 From: Jonathan Foucher <jfoucher@gmail.com> Date: Tue, 18 Feb 2025 11:09:06 +0100 Subject: [PATCH] delete notification_user when user or notificaiton is deleted. Fixes https://gitlab.adullact.net/soluris/madis/-/issues/997 --- src/Domain/Notification/Model/NotificationUser.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Domain/Notification/Model/NotificationUser.php b/src/Domain/Notification/Model/NotificationUser.php index c5fd4d99c..7e4c27e01 100644 --- a/src/Domain/Notification/Model/NotificationUser.php +++ b/src/Domain/Notification/Model/NotificationUser.php @@ -53,14 +53,14 @@ class NotificationUser /** * @ORM\ManyToOne(targetEntity="App\Domain\Notification\Model\Notification", inversedBy="notificationUsers") * - * @ORM\JoinColumn(name="notification_id", referencedColumnName="id") + * @ORM\JoinColumn(name="notification_id", referencedColumnName="id", onDelete="CASCADE") */ private Notification $notification; /** * @ORM\ManyToOne(targetEntity="App\Domain\User\Model\User", inversedBy="notifications") * - * @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=true) + * @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=true, onDelete="CASCADE") */ private ?User $user; -- GitLab