fix: adjust user id for postgresql in database seeder
This commit is contained in:
parent
bcd6f72b72
commit
6552a8c061
1 changed files with 8 additions and 1 deletions
|
@ -15,11 +15,18 @@ class UsersSeeder extends Seeder
|
||||||
// Groups
|
// Groups
|
||||||
if (! $user = User::find(1)) {
|
if (! $user = User::find(1)) {
|
||||||
$user = new User;
|
$user = new User;
|
||||||
$user->id = 1;
|
|
||||||
$user->username = 'admin';
|
$user->username = 'admin';
|
||||||
$user->email = 'admin@test.com';
|
$user->email = 'admin@test.com';
|
||||||
$user->password = null;
|
$user->password = null;
|
||||||
$user->save();
|
$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 {
|
} else {
|
||||||
//$user->save();
|
//$user->save();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue