From 004d567253759c133860bb5ec2f3d3d10aaae623 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 18 May 2022 03:31:00 -0700 Subject: [PATCH] Added some debugging Signed-off-by: snipe --- app/Console/Commands/MergeUsersByUsername.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Console/Commands/MergeUsersByUsername.php b/app/Console/Commands/MergeUsersByUsername.php index a3eb8f2d95..52690e8d6c 100644 --- a/app/Console/Commands/MergeUsersByUsername.php +++ b/app/Console/Commands/MergeUsersByUsername.php @@ -41,11 +41,16 @@ class MergeUsersByUsername extends Command { // Get the list of users who have an email address as their username $users = User::where('username', 'LIKE', '%@%')->whereNull('deleted_at')->get(); + $this->info($users->count().' total non-deleted users whose usernames contain a @ symbol.'); + foreach ($users as $user) { $parts = explode('@', $user->username); $bad_users = User::where('username', '=', $parts[0])->whereNull('deleted_at')->with('assets', 'manager', 'userlog', 'licenses', 'consumables', 'accessories', 'managedLocations')->get(); + $this->info($bad_users->count().' total non-deleted users whose usernames DO NOT contain a @ symbol.'); + + foreach ($bad_users as $bad_user) { $this->info($bad_user->username.' ('.$bad_user->id.') will be merged into '.$user->username.' ('.$user->id.') ');