mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-22 12:11:19 +00:00
Skip creation using if statement.
This commit is contained in:
@@ -46,11 +46,14 @@ class PermissionSeeder extends Seeder
|
||||
],
|
||||
];
|
||||
foreach ($roles as $role) {
|
||||
try {
|
||||
Role::create($role);
|
||||
} catch (\PDOException $e) {
|
||||
// @ignoreException
|
||||
if (null === Role::where('name', $role['name'])->first()) {
|
||||
try {
|
||||
Role::create($role);
|
||||
} catch (\PDOException $e) {
|
||||
// @ignoreException
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user