mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-07-04 00:11:44 +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();
|
$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();
|
$purger->purge();
|
||||||
|
|
||||||
//Afterwards run the load fixtures command as normal, but with the --append option
|
//Afterwards run the load fixtures command as normal, but with the --append option
|
||||||
$new_input = new ArrayInput([
|
$new_input = new ArrayInput([
|
||||||
'command' => 'doctrine:fixtures:load',
|
'command' => 'doctrine:fixtures:load',
|
||||||
|
'--purge-with-truncate' => true,
|
||||||
'--append' => true,
|
'--append' => true,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
@ -70,4 +73,4 @@ class LoadFixturesCommand extends Command
|
||||||
|
|
||||||
return $returnCode ?? Command::FAILURE;
|
return $returnCode ?? Command::FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue