mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-04-15 19:09:36 +00:00
Use truncatate purging during load fixtures to fix compatibility for postgres
This commit is contained in:
parent
57ef3e06a7
commit
05b1965957
1 changed files with 5 additions and 2 deletions
|
|
@ -56,13 +56,16 @@ class LoadFixturesCommand extends Command
|
|||
}
|
||||
|
||||
$factory = new ResetAutoIncrementPurgerFactory();
|
||||
$purger = $factory->createForEntityManager(null, $this->entityManager);
|
||||
|
||||
//Use truncate purging to fix compatibility with postgresql
|
||||
$purger = $factory->createForEntityManager(null, $this->entityManager, purgeWithTruncate: true);
|
||||
|
||||
$purger->purge();
|
||||
|
||||
//Afterwards run the load fixtures command as normal, but with the --append option
|
||||
$new_input = new ArrayInput([
|
||||
'command' => 'doctrine:fixtures:load',
|
||||
'--purge-with-truncate' => true,
|
||||
'--append' => true,
|
||||
]);
|
||||
|
||||
|
|
@ -70,4 +73,4 @@ class LoadFixturesCommand extends Command
|
|||
|
||||
return $returnCode ?? Command::FAILURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue