Reset autoincrements on SQLite with our ResetAutoIncrementPurger too and make it default for fixtures load

This commit is contained in:
Jan Böhmer 2023-06-18 22:06:06 +02:00
parent fe1715259a
commit 4977f6c270
3 changed files with 20 additions and 4 deletions

View file

@ -259,7 +259,16 @@ services:
tags:
- { name: 'doctrine.fixtures.purger_factory', alias: 'reset_autoincrement_purger' }
# We are needing this service inside of a migration, where only the container is injected. So we need to define it as public, to access it from the container.
# Decorate the doctrine fixtures load command to use our custom purger by default
doctrine.fixtures_load_command.custom:
decorates: doctrine.fixtures_load_command
class: Doctrine\Bundle\FixturesBundle\Command\LoadDataFixturesDoctrineCommand
arguments:
- '@doctrine.fixtures.loader'
- '@doctrine'
- { default: '@App\Doctrine\Purger\ResetAutoIncrementPurgerFactory' }
# We are needing this service inside a migration, where only the container is injected. So we need to define it as public, to access it from the container.
App\Services\UserSystem\PermissionPresetsHelper:
public: true