From 5b2a7dca6b498ee77a67d4cccda438fce800b37b Mon Sep 17 00:00:00 2001 From: Alain Van Driessche Date: Fri, 13 Dec 2024 18:56:20 +0100 Subject: [PATCH] Faster Process by removing useless deletions --- app/Jobs/ProcessUserDeletion.php | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/app/Jobs/ProcessUserDeletion.php b/app/Jobs/ProcessUserDeletion.php index 64cae5384..4c5a87121 100644 --- a/app/Jobs/ProcessUserDeletion.php +++ b/app/Jobs/ProcessUserDeletion.php @@ -44,25 +44,6 @@ public function handle() Event::where('approved_by', $this->userId) ->update(['approved_by' => $this->legacyUserId]); - // Update participations - Participation::where('user_id', $this->userId) - ->update(['user_id' => $this->legacyUserId]); - - // Update excellences - Excellence::where('user_id', $this->userId) - ->update(['user_id' => $this->legacyUserId]); - - // Update model_has_roles table directly - DB::table('model_has_roles') - ->where('model_id', $this->userId) - ->where('model_type', User::class) - ->update(['model_id' => $this->legacyUserId]); - - // Update leading_teacher_expertise_user table directly - DB::table('leading_teacher_expertise_user') - ->where('user_id', $this->userId) - ->update(['user_id' => $this->legacyUserId]); - // Hard delete the user User::where('id', $this->userId)->delete();