Use orphan removal for scheduled task subscriber entity

It is a connecting entity between task and subscriber, and it makes no sense
to keep without either of them. This could prevent some partial-delete bugs.

[MAILPOET-4375]
This commit is contained in:
Jan Jakes
2023-10-26 15:25:20 +02:00
committed by Aschepikov
parent b734a0642f
commit 8b01360627
3 changed files with 16 additions and 2 deletions

View File

@@ -45,13 +45,13 @@ class ScheduledTaskSubscriberEntity {
private $error;
/**
* @ORM\Id @ORM\ManyToOne(targetEntity="MailPoet\Entities\ScheduledTaskEntity")
* @ORM\Id @ORM\ManyToOne(targetEntity="MailPoet\Entities\ScheduledTaskEntity", inversedBy="scheduledTaskSubscribers")
* @var ScheduledTaskEntity|null
*/
private $task;
/**
* @ORM\Id @ORM\ManyToOne(targetEntity="MailPoet\Entities\SubscriberEntity")
* @ORM\Id @ORM\ManyToOne(targetEntity="MailPoet\Entities\SubscriberEntity", inversedBy="scheduledTaskSubscribers")
* @var SubscriberEntity|null
*/
private $subscriber;