Skip to content

Commit

Permalink
fix: Fix invalid Team and TeamAuthorization entites
Browse files Browse the repository at this point in the history
I don't know how those bugs found their way into the code, but they were
there.

The `createdBy` bugs are particularly weird as I'm pretty sure these
columns have been generated with the `make:entity` command.
  • Loading branch information
marien-probesys committed Mar 13, 2024
1 parent 15eca8a commit 0976e68
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Entity/Team.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Team implements MonitorableEntityInterface, UidEntityInterface
#[ORM\Column(type: Types::DATETIMETZ_IMMUTABLE)]
private ?\DateTimeImmutable $createdAt = null;

#[ORM\ManyToOne(inversedBy: 'teams')]
#[ORM\ManyToOne]
private ?User $createdBy = null;

#[ORM\Column(type: Types::DATETIMETZ_IMMUTABLE)]
Expand Down
8 changes: 3 additions & 5 deletions src/Entity/TeamAuthorization.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class TeamAuthorization implements MonitorableEntityInterface, UidEntityInterfac
#[ORM\Column(type: Types::DATETIMETZ_IMMUTABLE)]
private ?\DateTimeImmutable $createdAt = null;

#[ORM\ManyToOne(inversedBy: 'teams')]
#[ORM\ManyToOne]
private ?User $createdBy = null;

#[ORM\Column(type: Types::DATETIMETZ_IMMUTABLE)]
Expand All @@ -43,13 +43,11 @@ class TeamAuthorization implements MonitorableEntityInterface, UidEntityInterfac
private ?User $updatedBy = null;

#[ORM\ManyToOne(inversedBy: 'teamAuthorizations')]
#[ORM\JoinColumn(nullable: false)]
#[ORM\JoinColumn(onDelete: 'CASCADE')]
#[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
private ?Team $team = null;

#[ORM\ManyToOne]
#[ORM\JoinColumn(nullable: false)]
#[ORM\JoinColumn(onDelete: 'CASCADE')]
#[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
private ?Role $role = null;

#[ORM\ManyToOne(inversedBy: 'teamAuthorizations')]
Expand Down

0 comments on commit 0976e68

Please sign in to comment.