fix: adjust user id for postgresql in database seeder

This commit is contained in:
Attila Kerekes 2022-11-11 20:28:57 +00:00
parent bcd6f72b72
commit 6552a8c061

View file

@ -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();
}