Skip to content

Commit

Permalink
fix: Don't try to recreate roles in production
Browse files Browse the repository at this point in the history
  • Loading branch information
marien-probesys committed Sep 27, 2023
1 parent bc52f30 commit a3a6cf2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Command/SeedsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
// Seed roles (for both development and production environments)
$roleSuper = $this->roleRepository->findOrCreateSuperRole();

if ($this->roleRepository->count([]) > 1 && $this->environment === 'prod') {
return Command::SUCCESS;
}

$roleTech = $this->roleRepository->findOneOrCreateBy([
'name' => 'Technician',
], [
Expand Down

0 comments on commit a3a6cf2

Please sign in to comment.