From 6552a8c061bb79f5748b26878681c7a8bebc1c0d Mon Sep 17 00:00:00 2001 From: Attila Kerekes Date: Fri, 11 Nov 2022 20:28:57 +0000 Subject: [PATCH] fix: adjust user id for postgresql in database seeder --- database/seeds/UsersSeeder.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/database/seeds/UsersSeeder.php b/database/seeds/UsersSeeder.php index 869dbf99..996d7c68 100644 --- a/database/seeds/UsersSeeder.php +++ b/database/seeds/UsersSeeder.php @@ -15,11 +15,18 @@ class UsersSeeder extends Seeder // Groups if (! $user = User::find(1)) { $user = new User; - $user->id = 1; $user->username = 'admin'; $user->email = 'admin@test.com'; $user->password = null; $user->save(); + + $user_id = $user->id; + + if($user_id != 1) { + Log::info("First User returned with id $user_id from db! Changing to 1."); + + DB::update('update users set id = 1 where id = ?', [$user_id]); + } } else { //$user->save(); }