fix: update table scheme

This commit is contained in:
Maël Gangloff
2024-07-12 01:49:46 +02:00
parent d0c0c5beb3
commit 975199f328
4 changed files with 9 additions and 16 deletions

View File

@@ -8,7 +8,8 @@ use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: DomainEventRepository::class)]
class DomainEvent extends Event
{
#[ORM\ManyToOne(targetEntity: Domain::class, inversedBy: 'events')]
#[ORM\Id]
#[ORM\ManyToOne(targetEntity: Domain::class, cascade: ['persist'], inversedBy: 'events')]
#[ORM\JoinColumn(referencedColumnName: 'handle', nullable: false)]
private ?Domain $domain = null;

View File

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

View File

@@ -10,22 +10,13 @@ use Doctrine\ORM\Mapping as ORM;
class Event
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(enumType: EventAction::class)]
private ?EventAction $action = null;
#[ORM\Column]
#[ORM\Column(type: 'datetime_immutable')]
private ?DateTimeImmutable $date = null;
public function getId(): ?int
{
return $this->id;
}
public function getAction(): ?EventAction
{
return $this->action;