From f408d603cff02a7ac063d92d2e54cb332915c56e Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Sun, 3 Nov 2024 15:35:17 +0100 Subject: [PATCH] fix: change emails to lowercase on init --- app/Console/Commands/Init.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/Console/Commands/Init.php b/app/Console/Commands/Init.php index ccb864e1ff..f90afd2192 100644 --- a/app/Console/Commands/Init.php +++ b/app/Console/Commands/Init.php @@ -10,6 +10,7 @@ use App\Models\ScheduledDatabaseBackup; use App\Models\Server; use App\Models\StandalonePostgresql; +use App\Models\User; use Illuminate\Console\Command; use Illuminate\Support\Facades\File; use Illuminate\Support\Facades\Http; @@ -41,6 +42,7 @@ public function handle() $this->disable_metrics(); $this->replace_slash_in_environment_name(); $this->restore_coolify_db_backup(); + $this->update_user_emails(); // $this->update_traefik_labels(); if (! isCloud() || $this->option('force-cloud')) { @@ -92,6 +94,11 @@ private function disable_metrics() } } + private function update_user_emails() + { + User::whereRaw('email ~ \'[A-Z]\'')->get()->each(fn (User $user) => $user->update(['email' => strtolower($user->email)])); + } + private function update_traefik_labels() { try {