From 251f96ce1e1930aff7f7e49a379a775c874ad2b5 Mon Sep 17 00:00:00 2001 From: rem Date: Fri, 14 Jun 2024 12:10:18 +0200 Subject: [PATCH] add delete cascade on profile --- src/Entity/Post.php | 2 +- src/Entity/Profil.php | 4 ++-- var/data.db | Bin 114688 -> 114688 bytes 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Entity/Post.php b/src/Entity/Post.php index 615251b..7f8446b 100644 --- a/src/Entity/Post.php +++ b/src/Entity/Post.php @@ -40,7 +40,7 @@ class Post /** * @var Collection */ - #[ORM\OneToMany(targetEntity: Commentary::class, mappedBy: 'post')] + #[ORM\OneToMany(targetEntity: Commentary::class, mappedBy: 'post', cascade: ['persist', 'remove'])] private Collection $commentaries; /** diff --git a/src/Entity/Profil.php b/src/Entity/Profil.php index 4637abb..edf42b8 100644 --- a/src/Entity/Profil.php +++ b/src/Entity/Profil.php @@ -34,13 +34,13 @@ class Profil implements UserInterface, PasswordAuthenticatedUserInterface /** * @var Collection */ - #[ORM\OneToMany(targetEntity: Post::class, mappedBy: 'profil')] + #[ORM\OneToMany(targetEntity: Post::class, mappedBy: 'profil', cascade: ['remove'])] private Collection $posts; /** * @var Collection */ - #[ORM\OneToMany(targetEntity: Commentary::class, mappedBy: 'profil')] + #[ORM\OneToMany(targetEntity: Commentary::class, mappedBy: 'profil', cascade: ['remove'])] private Collection $commentaries; /** diff --git a/var/data.db b/var/data.db index a20c961c5c88c9bc77991e2d871e6407cd849778..e12a781479446a5def42ef35cfb1dedbf8155bf2 100644 GIT binary patch delta 331 zcmZo@U~gz(pCHW`G*QNxF=%7L5`7hZURwtKbbf2T2Yfkv4!mD@AM8*7%l0=TW5~qD04)t!pg5yHD|2R^ zLZU)(Mq*L6LUBocZentVf`=mnI(jH5Dk^SrxXtg&&&SNH$e5g;o12X?x zWCs@`vm|3dQGQxx4ks7?JO+OLNeujt`0w!V=D)yyjsF<`O8y!ATlv@XzvG|8|Al`s z|1bU*n>7Ls^INhpFt9Q+GP1~lNLE=8$tlUj{{m>lL}vcS{5OD_mhjKzKf`~Qe+$r< z13<%e@n7PfzF8$<1wRi9Gbf`Q*aT+T%{TI`6BwUwY}Dr4Y=7_EMdsNoOdA{bv1~uL Ih0%x`0AK7|VE_OC delta 288 zcmZo@U~gz(pCHZXGEv5v(Pd-85`7guURwtKbbf2T2Yfkv4!mD@AM