diff --git a/src/Entity/MissionCategory.php b/src/Entity/MissionCategory.php index 3081dc2..862d5a8 100644 --- a/src/Entity/MissionCategory.php +++ b/src/Entity/MissionCategory.php @@ -6,17 +6,16 @@ use App\Repository\MissionCategoryRepository; use Doctrine\ORM\Mapping as ORM; #[ORM\Entity(repositoryClass: MissionCategoryRepository::class)] -#[ORM\UniqueConstraint(columns: ['mission', 'category'])] class MissionCategory { #[ORM\Id] - #[ORM\ManyToOne(targetEntity: Mission::class, inversedBy: 'missionCategories')] - #[ORM\Column(type: 'integer')] + #[ORM\OneToMany(targetEntity: Mission::class, mappedBy: 'MissionCategory')] + #[ORM\JoinColumn(nullable: false)] private ?Mission $mission = null; #[ORM\Id] - #[ORM\ManyToOne(targetEntity: Category::class, inversedBy: 'missionCategories')] - #[ORM\Column(type: 'integer')] + #[ORM\OneToMany(targetEntity: Category::class, mappedBy: 'MissionCategory')] + #[ORM\JoinColumn(nullable: false)] private ?Category $category = null; public function getMission(): ?Mission