diff --git a/src/Provider/Doctrine/Persistence/Schema/SchemaManager.php b/src/Provider/Doctrine/Persistence/Schema/SchemaManager.php index d034c609..ac6b4a33 100644 --- a/src/Provider/Doctrine/Persistence/Schema/SchemaManager.php +++ b/src/Provider/Doctrine/Persistence/Schema/SchemaManager.php @@ -270,7 +270,7 @@ public function resolveAuditTableName(string $entity, Configuration $configurati public function computeAuditTablename(string $entityTableName, Configuration $configuration): ?string { return preg_replace( - sprintf('#^([^\.]+\.)?(%s)$#', preg_quote($entityTableName, '#')), + '#^([^.]+\.)?(.+)$#', sprintf( '$1%s$2%s', preg_quote($configuration->getTablePrefix(), '#'), diff --git a/tests/Provider/Doctrine/Issues/Issue174Test.php b/tests/Provider/Doctrine/Issues/Issue174Test.php new file mode 100644 index 00000000..aee4f397 --- /dev/null +++ b/tests/Provider/Doctrine/Issues/Issue174Test.php @@ -0,0 +1,30 @@ + 'audit_', 'table_suffix' => '_suffix']); + $manager = new SchemaManager($this->provider); + $result = $manager->computeAuditTablename('schema.entity', $configuration); + self::assertSame('schema.audit_entity_suffix', $result); + } +}