mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
fix: prevent duplicate events in database
This commit is contained in:
@@ -6,6 +6,9 @@ use App\Repository\DomainEventRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: DomainEventRepository::class)]
|
||||
#[ORM\UniqueConstraint(
|
||||
columns: ['action', 'date', 'domain_id']
|
||||
)]
|
||||
class DomainEvent extends Event
|
||||
{
|
||||
#[ORM\ManyToOne(targetEntity: Domain::class, inversedBy: 'events')]
|
||||
|
||||
@@ -6,6 +6,9 @@ use App\Repository\EntityEventRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: EntityEventRepository::class)]
|
||||
#[ORM\UniqueConstraint(
|
||||
columns: ['action', 'date', 'entity_id']
|
||||
)]
|
||||
class EntityEvent extends Event
|
||||
{
|
||||
#[ORM\ManyToOne(targetEntity: Entity::class, inversedBy: 'events')]
|
||||
|
||||
@@ -312,6 +312,7 @@ readonly class RDAPService
|
||||
|
||||
if (array_key_exists('nameservers', $res) && is_array($res['nameservers'])) {
|
||||
$domain->getNameservers()->clear();
|
||||
$this->em->persist($domain);
|
||||
|
||||
foreach ($res['nameservers'] as $rdapNameserver) {
|
||||
$nameserver = $this->nameserverRepository->findOneBy([
|
||||
|
||||
Reference in New Issue
Block a user