Implemented proof of concept to convert between database types

This commit is contained in:
Jan Böhmer 2026-01-05 22:41:40 +01:00
parent 2157916e9b
commit 96a37a0cb0
3 changed files with 166 additions and 50 deletions

View file

@ -39,10 +39,10 @@ class PKImportHelper
* Existing users and groups are not purged.
* This is needed to avoid ID collisions.
*/
public function purgeDatabaseForImport(): void
public function purgeDatabaseForImport(?EntityManagerInterface $entityManager = null, array $excluded_tables = ['users', 'groups', 'u2f_keys', 'internal', 'migration_versions']): void
{
//We use the ResetAutoIncrementORMPurger to reset the auto increment values of the tables. Also it normalizes table names before checking for exclusion.
$purger = new ResetAutoIncrementORMPurger($this->em, ['users', 'groups', 'u2f_keys', 'internal', 'migration_versions']);
$purger = new ResetAutoIncrementORMPurger($entityManager ?? $this->em, $excluded_tables);
$purger->purge();
}