From a258905c599b993eb76a0ee7daa3d5c4b86cf6f9 Mon Sep 17 00:00:00 2001 From: Marc Ducobu Date: Tue, 15 Jun 2021 11:23:43 +0200 Subject: [PATCH] Add unique constraint (class, id) to notifications --- src/Bundle/ChillMainBundle/Entity/Notification.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillMainBundle/Entity/Notification.php b/src/Bundle/ChillMainBundle/Entity/Notification.php index 76a4b1e4c..51ea0e39f 100644 --- a/src/Bundle/ChillMainBundle/Entity/Notification.php +++ b/src/Bundle/ChillMainBundle/Entity/Notification.php @@ -27,7 +27,12 @@ use Doctrine\ORM\Mapping as ORM; /** * @ORM\Entity(repositoryClass=NotificationRepository::class) - * @ORM\Table(name="chill_main_notification") + * @ORM\Table( + * name="chill_main_notification", + * uniqueConstraints={ + * @ORM\UniqueConstraint(columns={"relatedEntityClass", "relatedEntityId"}) + * } + * ) */ class Notification {