This commit is contained in:
afornerot 2023-07-20 20:20:41 +02:00
parent bd06832205
commit 1d0e313dbc
1 changed files with 1 additions and 1 deletions

View File

@ -51,7 +51,7 @@ class InitCommand extends Command
$metadata = $this->em->getClassMetaData('App\Entity\User');
$metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_NONE);
$metadata->setIdGenerator(new AssignedGenerator());
$user = $this->em->getRepository('App\Entity\User')->findOneBy(['id' => '-1']);
$user = $this->em->getRepository('App\Entity\User')->findOneBy(['username' => 'admin']);
if (!$user) {
$user = new User();
$user->setId(-1);