fix: update table scheme

This commit is contained in:
Maël Gangloff
2024-07-13 17:04:29 +02:00
parent 69dc301257
commit 63abc32d57
6 changed files with 20 additions and 47 deletions

View File

@@ -17,7 +17,7 @@ class DomainEntity
#[ORM\Id]
#[ORM\ManyToOne(targetEntity: Entity::class, cascade: ['persist'], inversedBy: 'domainEntities')]
#[ORM\JoinColumn(referencedColumnName: 'id', nullable: false)]
#[ORM\JoinColumn(referencedColumnName: 'handle', nullable: false)]
private ?Entity $entity = null;
#[ORM\Column(type: Types::SIMPLE_ARRAY, enumType: DomainRole::class)]

View File

@@ -11,18 +11,11 @@ use Doctrine\ORM\Mapping as ORM;
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>
*/
@@ -51,11 +44,6 @@ class Entity
$this->events = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getHandle(): ?string
{
return $this->handle;
@@ -68,18 +56,6 @@ 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>
*/

View File

@@ -10,7 +10,7 @@ class EntityEvent extends Event
{
#[ORM\ManyToOne(targetEntity: Entity::class, inversedBy: 'events')]
#[ORM\JoinColumn(referencedColumnName: 'id', nullable: false)]
#[ORM\JoinColumn(referencedColumnName: 'handle', nullable: false)]
private ?Entity $entity = null;

View File

@@ -18,7 +18,7 @@ class NameserverEntity
#[ORM\Id]
#[ORM\ManyToOne(targetEntity: Entity::class, cascade: ['persist'], inversedBy: 'nameserverEntities')]
#[ORM\JoinColumn(referencedColumnName: 'id', nullable: false)]
#[ORM\JoinColumn(referencedColumnName: 'handle', nullable: false)]
private ?Entity $entity = null;