mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
fix: update table scheme
This commit is contained in:
@@ -45,7 +45,7 @@ class Domain
|
||||
*/
|
||||
#[ORM\ManyToMany(targetEntity: Nameserver::class, inversedBy: 'domains', cascade: ['persist'])]
|
||||
#[ORM\JoinTable(name: 'domain_nameservers',
|
||||
joinColumns: [new ORM\JoinColumn(name: 'domain_handle', referencedColumnName: 'handle')],
|
||||
joinColumns: [new ORM\JoinColumn(name: 'domain_ldh_name', referencedColumnName: 'ldh_name')],
|
||||
inverseJoinColumns: [new ORM\JoinColumn(name: 'nameserver_ldh_name', referencedColumnName: 'ldh_name')]
|
||||
)]
|
||||
private Collection $nameservers;
|
||||
|
||||
@@ -17,7 +17,7 @@ class DomainEntity
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\ManyToOne(targetEntity: Entity::class, cascade: ['persist'], inversedBy: 'domainEntities')]
|
||||
#[ORM\JoinColumn(referencedColumnName: 'handle', nullable: false)]
|
||||
#[ORM\JoinColumn(referencedColumnName: 'id', nullable: false)]
|
||||
private ?Entity $entity = null;
|
||||
|
||||
#[ORM\Column(type: Types::SIMPLE_ARRAY, enumType: DomainRole::class)]
|
||||
|
||||
@@ -10,10 +10,19 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
#[ORM\Entity(repositoryClass: EntityRepository::class)]
|
||||
class Entity
|
||||
{
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $handle = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $tld = null;
|
||||
|
||||
/**
|
||||
* @var Collection<int, DomainEntity>
|
||||
*/
|
||||
@@ -42,6 +51,11 @@ class Entity
|
||||
$this->events = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getHandle(): ?string
|
||||
{
|
||||
return $this->handle;
|
||||
@@ -54,6 +68,18 @@ class Entity
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTld(): ?string
|
||||
{
|
||||
return $this->tld;
|
||||
}
|
||||
|
||||
public function setTld(string $tld): static
|
||||
{
|
||||
$this->tld = $tld;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, DomainEntity>
|
||||
*/
|
||||
|
||||
@@ -10,10 +10,11 @@ class EntityEvent extends Event
|
||||
{
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: Entity::class, inversedBy: 'events')]
|
||||
#[ORM\JoinColumn(referencedColumnName: 'handle', nullable: false)]
|
||||
#[ORM\JoinColumn(referencedColumnName: 'id', nullable: false)]
|
||||
private ?Entity $entity = null;
|
||||
|
||||
|
||||
|
||||
public function getEntity(): ?Entity
|
||||
{
|
||||
return $this->entity;
|
||||
|
||||
@@ -15,9 +15,6 @@ class Nameserver
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $ldhName = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $handle = null;
|
||||
|
||||
/**
|
||||
* @var Collection<int, NameserverEntity>
|
||||
*/
|
||||
@@ -48,18 +45,6 @@ class Nameserver
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getHandle(): ?string
|
||||
{
|
||||
return $this->handle;
|
||||
}
|
||||
|
||||
public function setHandle(string $handle): static
|
||||
{
|
||||
$this->handle = $handle;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, NameserverEntity>
|
||||
*/
|
||||
|
||||
@@ -18,9 +18,10 @@ class NameserverEntity
|
||||
|
||||
#[ORM\Id]
|
||||
#[ORM\ManyToOne(targetEntity: Entity::class, cascade: ['persist'], inversedBy: 'nameserverEntities')]
|
||||
#[ORM\JoinColumn(referencedColumnName: 'handle', nullable: false)]
|
||||
#[ORM\JoinColumn(referencedColumnName: 'id', nullable: false)]
|
||||
private ?Entity $entity = null;
|
||||
|
||||
|
||||
#[ORM\Column(type: Types::SIMPLE_ARRAY, enumType: DomainRole::class)]
|
||||
private array $roles = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user