From 63c6f01851981214f9c9260b829f7b5f738bb754 Mon Sep 17 00:00:00 2001 From: Oleg Usik Date: Tue, 5 Sep 2023 22:11:27 +0300 Subject: [PATCH 1/6] Added the with_foreign_keys parameter to allow disabling the creation of foreign keys --- src/AuditConfiguration.php | 12 ++++++++ src/DependencyInjection/Configuration.php | 1 + .../SimpleThingsEntityAuditExtension.php | 1 + src/EventListener/CreateSchemaListener.php | 29 ++++++++++++------- src/Resources/config/auditable.php | 5 +++- 5 files changed, 36 insertions(+), 12 deletions(-) diff --git a/src/AuditConfiguration.php b/src/AuditConfiguration.php index 7f24530f..b1e7bd33 100644 --- a/src/AuditConfiguration.php +++ b/src/AuditConfiguration.php @@ -26,6 +26,8 @@ class AuditConfiguration */ private array $auditedEntityClasses = []; + private bool $withForeignKeys = true; + /** * @var string[] */ @@ -79,6 +81,16 @@ public function getTableName(ClassMetadataInfo $metadata) return $this->getTablePrefix().$tableName.$this->getTableSuffix(); } + public function getWithForeignKeys(): bool + { + return $this->withForeignKeys; + } + + public function setWithForeignKeys(bool $withForeignKeys): void + { + $this->withForeignKeys = $withForeignKeys; + } + /** * @return string */ diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 472b4629..af4caebe 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -54,6 +54,7 @@ public function getConfigTreeBuilder() ->scalarNode('revision_field_name')->defaultValue('rev')->end() ->scalarNode('revision_type_field_name')->defaultValue('revtype')->end() ->scalarNode('revision_table_name')->defaultValue('revisions')->end() + ->scalarNode('with_foreign_keys')->defaultValue('default')->end() ->scalarNode('revision_id_field_type') ->defaultValue(Types::INTEGER) // NEXT_MAJOR: Use enumNode() instead. diff --git a/src/DependencyInjection/SimpleThingsEntityAuditExtension.php b/src/DependencyInjection/SimpleThingsEntityAuditExtension.php index ce4513e0..1126ae04 100644 --- a/src/DependencyInjection/SimpleThingsEntityAuditExtension.php +++ b/src/DependencyInjection/SimpleThingsEntityAuditExtension.php @@ -39,6 +39,7 @@ public function load(array $configs, ContainerBuilder $container): void 'revision_table_name', 'revision_id_field_type', 'global_ignore_columns', + 'with_foreign_keys', ]; foreach ($configurables as $key) { diff --git a/src/EventListener/CreateSchemaListener.php b/src/EventListener/CreateSchemaListener.php index 97b027ca..f49f8f2b 100644 --- a/src/EventListener/CreateSchemaListener.php +++ b/src/EventListener/CreateSchemaListener.php @@ -119,17 +119,9 @@ public function postGenerateSchemaTable(GenerateSchemaTableEventArgs $eventArgs) } } - $revisionForeignKeyName = $this->config->getRevisionFieldName().'_'.md5($revisionTable->getName()).'_fk'; - $primaryKey = $revisionsTable->getPrimaryKey(); - \assert(null !== $primaryKey); - - $revisionTable->addForeignKeyConstraint( - $revisionsTable, - [$this->config->getRevisionFieldName()], - $primaryKey->getColumns(), - [], - $revisionForeignKeyName - ); + if ($this->config->getWithForeignKeys()) { + $this->createForeignKeys($revisionTable, $revisionsTable); + } } public function postGenerateSchema(GenerateSchemaEventArgs $eventArgs): void @@ -142,6 +134,21 @@ public function postGenerateSchema(GenerateSchemaEventArgs $eventArgs): void } } + private function createForeignKeys(Table $relatedTable, Table $revisionsTable): void + { + $revisionForeignKeyName = $this->config->getRevisionFieldName().'_'.md5($relatedTable->getName()).'_fk'; + $primaryKey = $revisionsTable->getPrimaryKey(); + \assert(null !== $primaryKey); + + $relatedTable->addForeignKeyConstraint( + $revisionsTable, + [$this->config->getRevisionFieldName()], + $primaryKey->getColumns(), + [], + $revisionForeignKeyName + ); + } + /** * Copies $column to another table. All its options are copied but notnull and autoincrement which are set to false. */ diff --git a/src/Resources/config/auditable.php b/src/Resources/config/auditable.php index 53b73758..74aa3d6a 100644 --- a/src/Resources/config/auditable.php +++ b/src/Resources/config/auditable.php @@ -47,7 +47,9 @@ ->set('simplethings.entityaudit.revision_table_name', null) - ->set('simplethings.entityaudit.revision_id_field_type', null); + ->set('simplethings.entityaudit.revision_id_field_type', null) + + ->set('simplethings.entityaudit.with_foreign_keys', null); $containerConfigurator->services() ->set('simplethings_entityaudit.manager', AuditManager::class) @@ -119,6 +121,7 @@ ->set('simplethings_entityaudit.config', AuditConfiguration::class) ->public() ->call('setAuditedEntityClasses', [param('simplethings.entityaudit.audited_entities')]) + ->call('setWithForeignKeys', [param('simplethings.entityaudit.with_foreign_keys')]) ->call('setGlobalIgnoreColumns', [param('simplethings.entityaudit.global_ignore_columns')]) ->call('setTablePrefix', [param('simplethings.entityaudit.table_prefix')]) ->call('setTableSuffix', [param('simplethings.entityaudit.table_suffix')]) From c91ff7de1319838f1f99f5f7d3c65f7472dfe7d3 Mon Sep 17 00:00:00 2001 From: Oleg Usik Date: Tue, 5 Sep 2023 22:11:46 +0300 Subject: [PATCH 2/6] Added tests --- .../SimpleThingsEntityAuditExtensionTest.php | 4 + tests/NoForeignKeysTest.php | 82 +++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 tests/NoForeignKeysTest.php diff --git a/tests/DependencyInjection/SimpleThingsEntityAuditExtensionTest.php b/tests/DependencyInjection/SimpleThingsEntityAuditExtensionTest.php index 28699147..d546c3f7 100644 --- a/tests/DependencyInjection/SimpleThingsEntityAuditExtensionTest.php +++ b/tests/DependencyInjection/SimpleThingsEntityAuditExtensionTest.php @@ -61,6 +61,7 @@ public function testItRegistersDefaultServices(): void $this->assertContainerBuilderHasServiceDefinitionWithMethodCall('simplethings_entityaudit.config', 'setRevisionIdFieldType', ['%simplethings.entityaudit.revision_id_field_type%']); $this->assertContainerBuilderHasServiceDefinitionWithMethodCall('simplethings_entityaudit.config', 'setRevisionFieldName', ['%simplethings.entityaudit.revision_field_name%']); $this->assertContainerBuilderHasServiceDefinitionWithMethodCall('simplethings_entityaudit.config', 'setRevisionTypeFieldName', ['%simplethings.entityaudit.revision_type_field_name%']); + $this->assertContainerBuilderHasServiceDefinitionWithMethodCall('simplethings_entityaudit.config', 'setWithForeignKeys', ['%simplethings.entityaudit.with_foreign_keys%']); $this->assertContainerBuilderHasServiceDefinitionWithMethodCall('simplethings_entityaudit.config', 'setUsernameCallable', ['simplethings_entityaudit.username_callable']); } @@ -102,6 +103,7 @@ public function testItSetsDefaultParameters(): void $this->assertContainerBuilderHasParameter('simplethings.entityaudit.revision_field_name', 'rev'); $this->assertContainerBuilderHasParameter('simplethings.entityaudit.revision_type_field_name', 'revtype'); $this->assertContainerBuilderHasParameter('simplethings.entityaudit.revision_id_field_type', Types::INTEGER); + $this->assertContainerBuilderHasParameter('simplethings.entityaudit.with_foreign_keys', true); } public function testItSetsConfiguredParameters(): void @@ -117,6 +119,7 @@ public function testItSetsConfiguredParameters(): void 'revision_id_field_type' => Types::GUID, 'revision_field_name' => 'revision', 'revision_type_field_name' => 'action', + 'with_foreign_keys' => true, ]); $this->assertContainerBuilderHasParameter('simplethings.entityaudit.connection', 'my_custom_connection'); @@ -129,6 +132,7 @@ public function testItSetsConfiguredParameters(): void $this->assertContainerBuilderHasParameter('simplethings.entityaudit.revision_id_field_type', Types::GUID); $this->assertContainerBuilderHasParameter('simplethings.entityaudit.revision_field_name', 'revision'); $this->assertContainerBuilderHasParameter('simplethings.entityaudit.revision_type_field_name', 'action'); + $this->assertContainerBuilderHasParameter('simplethings.entityaudit.with_foreign_keys', true); foreach ([Events::onFlush, Events::postPersist, Events::postUpdate, Events::postFlush, Events::onClear] as $event) { $this->assertContainerBuilderHasServiceDefinitionWithTag('simplethings_entityaudit.log_revisions_listener', 'doctrine.event_listener', ['event' => $event, 'connection' => 'my_custom_connection']); diff --git a/tests/NoForeignKeysTest.php b/tests/NoForeignKeysTest.php new file mode 100644 index 00000000..336a2d71 --- /dev/null +++ b/tests/NoForeignKeysTest.php @@ -0,0 +1,82 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Sonata\EntityAuditBundle\Tests; + +use Doctrine\DBAL\Exception; +use Doctrine\ORM\Exception\ORMException; +use Doctrine\ORM\OptimisticLockException; +use SimpleThings\EntityAudit\AuditConfiguration; +use SimpleThings\EntityAudit\AuditManager; +use SimpleThings\EntityAudit\Exception\NotAuditedException; +use Sonata\EntityAuditBundle\Tests\Fixtures\Core\UserAudit; + +final class NoForeignKeysTest extends BaseTest +{ + protected $schemaEntities = [ + UserAudit::class, + ]; + + protected $auditedEntities = [ + UserAudit::class, + ]; + + /** + * @throws OptimisticLockException + * @throws ORMException + * @throws NotAuditedException + * @throws Exception + */ + public function testRevisionForeignKeys(): void + { + $em = $this->getEntityManager(); + + $user = new UserAudit('phansys'); + + $em->persist($user); + $em->flush(); + + $reader = $this->getAuditManager()->createAuditReader($em); + + $userId = $user->getId(); + static::assertNotNull($userId); + + $revisions = $reader->findRevisions(UserAudit::class, $userId); + + static::assertCount(1, $revisions); + + $revision = $reader->getCurrentRevision(UserAudit::class, $userId); + static::assertSame('1', (string) $revision); + + $revisionsTableName = $this->getAuditManager()->getConfiguration()->getRevisionTableName(); + + $em->getConnection()->delete($revisionsTableName, ['id' => $revision]); + } + + protected function getAuditManager(): AuditManager + { + if (null !== $this->auditManager) { + return $this->auditManager; + } + + $auditConfig = AuditConfiguration::forEntities($this->auditedEntities); + $auditConfig->setGlobalIgnoreColumns(['ignoreme']); + $auditConfig->setWithForeignKeys(false); + $auditConfig->setUsernameCallable(static fn (): string => 'beberlei'); + + $this->auditManager = new AuditManager($auditConfig, $this->getClock()); + $this->auditManager->registerEvents($this->getEntityManager()->getEventManager()); + + return $this->auditManager; + } +} From 193dee721002335c481850de3cf7e1890ad93f8d Mon Sep 17 00:00:00 2001 From: Oleg Usik Date: Tue, 5 Sep 2023 22:34:01 +0300 Subject: [PATCH 3/6] Added description of disabling foreign key constraints --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index bbcdabcb..584ae5f8 100755 --- a/README.md +++ b/README.md @@ -110,6 +110,12 @@ simple_things_entity_audit: entity_manager: custom ``` +If there is no need to create foreign keys for any reason, you can specify the corresponding parameter: +```yaml +simple_things_entity_audit: + with_foreign_keys: false +``` + ### Creating new tables Call the command below to see the new tables in the update schema queue. From 69958fb23d4b253f452b6e4ef1f8a1b4d9f825eb Mon Sep 17 00:00:00 2001 From: Oleg Usik Date: Tue, 5 Sep 2023 22:45:41 +0300 Subject: [PATCH 4/6] Default value in the config file has been corrected --- src/DependencyInjection/Configuration.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index af4caebe..46248b66 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -54,7 +54,7 @@ public function getConfigTreeBuilder() ->scalarNode('revision_field_name')->defaultValue('rev')->end() ->scalarNode('revision_type_field_name')->defaultValue('revtype')->end() ->scalarNode('revision_table_name')->defaultValue('revisions')->end() - ->scalarNode('with_foreign_keys')->defaultValue('default')->end() + ->scalarNode('with_foreign_keys')->defaultValue(true)->end() ->scalarNode('revision_id_field_type') ->defaultValue(Types::INTEGER) // NEXT_MAJOR: Use enumNode() instead. From 4e6ebb3d611f3215ba41ea7f243a184a6bbf6605 Mon Sep 17 00:00:00 2001 From: Oleg Usik Date: Tue, 5 Sep 2023 22:59:58 +0300 Subject: [PATCH 5/6] Renamed configuration parameter --- README.md | 2 +- src/AuditConfiguration.php | 10 +++++----- src/DependencyInjection/Configuration.php | 2 +- .../SimpleThingsEntityAuditExtension.php | 2 +- src/EventListener/CreateSchemaListener.php | 2 +- src/Resources/config/auditable.php | 4 ++-- .../SimpleThingsEntityAuditExtensionTest.php | 8 ++++---- tests/NoForeignKeysTest.php | 2 +- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 584ae5f8..ebf225e3 100755 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ simple_things_entity_audit: If there is no need to create foreign keys for any reason, you can specify the corresponding parameter: ```yaml simple_things_entity_audit: - with_foreign_keys: false + disable_foreign_keys: true ``` ### Creating new tables diff --git a/src/AuditConfiguration.php b/src/AuditConfiguration.php index b1e7bd33..6f3984f9 100644 --- a/src/AuditConfiguration.php +++ b/src/AuditConfiguration.php @@ -26,7 +26,7 @@ class AuditConfiguration */ private array $auditedEntityClasses = []; - private bool $withForeignKeys = true; + private bool $disableForeignKeys = false; /** * @var string[] @@ -81,14 +81,14 @@ public function getTableName(ClassMetadataInfo $metadata) return $this->getTablePrefix().$tableName.$this->getTableSuffix(); } - public function getWithForeignKeys(): bool + public function isDisabledForeignKeys(): bool { - return $this->withForeignKeys; + return $this->disableForeignKeys; } - public function setWithForeignKeys(bool $withForeignKeys): void + public function setDisabledForeignKeys(bool $disabled): void { - $this->withForeignKeys = $withForeignKeys; + $this->disableForeignKeys = $disabled; } /** diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 46248b66..55225557 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -54,7 +54,7 @@ public function getConfigTreeBuilder() ->scalarNode('revision_field_name')->defaultValue('rev')->end() ->scalarNode('revision_type_field_name')->defaultValue('revtype')->end() ->scalarNode('revision_table_name')->defaultValue('revisions')->end() - ->scalarNode('with_foreign_keys')->defaultValue(true)->end() + ->scalarNode('disable_foreign_keys')->defaultValue(false)->end() ->scalarNode('revision_id_field_type') ->defaultValue(Types::INTEGER) // NEXT_MAJOR: Use enumNode() instead. diff --git a/src/DependencyInjection/SimpleThingsEntityAuditExtension.php b/src/DependencyInjection/SimpleThingsEntityAuditExtension.php index 1126ae04..9fecb9ee 100644 --- a/src/DependencyInjection/SimpleThingsEntityAuditExtension.php +++ b/src/DependencyInjection/SimpleThingsEntityAuditExtension.php @@ -39,7 +39,7 @@ public function load(array $configs, ContainerBuilder $container): void 'revision_table_name', 'revision_id_field_type', 'global_ignore_columns', - 'with_foreign_keys', + 'disable_foreign_keys', ]; foreach ($configurables as $key) { diff --git a/src/EventListener/CreateSchemaListener.php b/src/EventListener/CreateSchemaListener.php index f49f8f2b..8ab70ae8 100644 --- a/src/EventListener/CreateSchemaListener.php +++ b/src/EventListener/CreateSchemaListener.php @@ -119,7 +119,7 @@ public function postGenerateSchemaTable(GenerateSchemaTableEventArgs $eventArgs) } } - if ($this->config->getWithForeignKeys()) { + if (!$this->config->isDisabledForeignKeys()) { $this->createForeignKeys($revisionTable, $revisionsTable); } } diff --git a/src/Resources/config/auditable.php b/src/Resources/config/auditable.php index 74aa3d6a..00b8b92b 100644 --- a/src/Resources/config/auditable.php +++ b/src/Resources/config/auditable.php @@ -49,7 +49,7 @@ ->set('simplethings.entityaudit.revision_id_field_type', null) - ->set('simplethings.entityaudit.with_foreign_keys', null); + ->set('simplethings.entityaudit.disable_foreign_keys', null); $containerConfigurator->services() ->set('simplethings_entityaudit.manager', AuditManager::class) @@ -121,7 +121,7 @@ ->set('simplethings_entityaudit.config', AuditConfiguration::class) ->public() ->call('setAuditedEntityClasses', [param('simplethings.entityaudit.audited_entities')]) - ->call('setWithForeignKeys', [param('simplethings.entityaudit.with_foreign_keys')]) + ->call('setDisabledForeignKeys', [param('simplethings.entityaudit.disable_foreign_keys')]) ->call('setGlobalIgnoreColumns', [param('simplethings.entityaudit.global_ignore_columns')]) ->call('setTablePrefix', [param('simplethings.entityaudit.table_prefix')]) ->call('setTableSuffix', [param('simplethings.entityaudit.table_suffix')]) diff --git a/tests/DependencyInjection/SimpleThingsEntityAuditExtensionTest.php b/tests/DependencyInjection/SimpleThingsEntityAuditExtensionTest.php index d546c3f7..ece94d08 100644 --- a/tests/DependencyInjection/SimpleThingsEntityAuditExtensionTest.php +++ b/tests/DependencyInjection/SimpleThingsEntityAuditExtensionTest.php @@ -61,7 +61,7 @@ public function testItRegistersDefaultServices(): void $this->assertContainerBuilderHasServiceDefinitionWithMethodCall('simplethings_entityaudit.config', 'setRevisionIdFieldType', ['%simplethings.entityaudit.revision_id_field_type%']); $this->assertContainerBuilderHasServiceDefinitionWithMethodCall('simplethings_entityaudit.config', 'setRevisionFieldName', ['%simplethings.entityaudit.revision_field_name%']); $this->assertContainerBuilderHasServiceDefinitionWithMethodCall('simplethings_entityaudit.config', 'setRevisionTypeFieldName', ['%simplethings.entityaudit.revision_type_field_name%']); - $this->assertContainerBuilderHasServiceDefinitionWithMethodCall('simplethings_entityaudit.config', 'setWithForeignKeys', ['%simplethings.entityaudit.with_foreign_keys%']); + $this->assertContainerBuilderHasServiceDefinitionWithMethodCall('simplethings_entityaudit.config', 'setDisabledForeignKeys', ['%simplethings.entityaudit.disable_foreign_keys%']); $this->assertContainerBuilderHasServiceDefinitionWithMethodCall('simplethings_entityaudit.config', 'setUsernameCallable', ['simplethings_entityaudit.username_callable']); } @@ -103,7 +103,7 @@ public function testItSetsDefaultParameters(): void $this->assertContainerBuilderHasParameter('simplethings.entityaudit.revision_field_name', 'rev'); $this->assertContainerBuilderHasParameter('simplethings.entityaudit.revision_type_field_name', 'revtype'); $this->assertContainerBuilderHasParameter('simplethings.entityaudit.revision_id_field_type', Types::INTEGER); - $this->assertContainerBuilderHasParameter('simplethings.entityaudit.with_foreign_keys', true); + $this->assertContainerBuilderHasParameter('simplethings.entityaudit.disable_foreign_keys', false); } public function testItSetsConfiguredParameters(): void @@ -119,7 +119,7 @@ public function testItSetsConfiguredParameters(): void 'revision_id_field_type' => Types::GUID, 'revision_field_name' => 'revision', 'revision_type_field_name' => 'action', - 'with_foreign_keys' => true, + 'disable_foreign_keys' => false, ]); $this->assertContainerBuilderHasParameter('simplethings.entityaudit.connection', 'my_custom_connection'); @@ -132,7 +132,7 @@ public function testItSetsConfiguredParameters(): void $this->assertContainerBuilderHasParameter('simplethings.entityaudit.revision_id_field_type', Types::GUID); $this->assertContainerBuilderHasParameter('simplethings.entityaudit.revision_field_name', 'revision'); $this->assertContainerBuilderHasParameter('simplethings.entityaudit.revision_type_field_name', 'action'); - $this->assertContainerBuilderHasParameter('simplethings.entityaudit.with_foreign_keys', true); + $this->assertContainerBuilderHasParameter('simplethings.entityaudit.disable_foreign_keys', false); foreach ([Events::onFlush, Events::postPersist, Events::postUpdate, Events::postFlush, Events::onClear] as $event) { $this->assertContainerBuilderHasServiceDefinitionWithTag('simplethings_entityaudit.log_revisions_listener', 'doctrine.event_listener', ['event' => $event, 'connection' => 'my_custom_connection']); diff --git a/tests/NoForeignKeysTest.php b/tests/NoForeignKeysTest.php index 336a2d71..44687b7d 100644 --- a/tests/NoForeignKeysTest.php +++ b/tests/NoForeignKeysTest.php @@ -71,7 +71,7 @@ protected function getAuditManager(): AuditManager $auditConfig = AuditConfiguration::forEntities($this->auditedEntities); $auditConfig->setGlobalIgnoreColumns(['ignoreme']); - $auditConfig->setWithForeignKeys(false); + $auditConfig->setDisabledForeignKeys(true); $auditConfig->setUsernameCallable(static fn (): string => 'beberlei'); $this->auditManager = new AuditManager($auditConfig, $this->getClock()); From 465d752ebbfd8f8ed565914cd6bba992c6510093 Mon Sep 17 00:00:00 2001 From: Oleg Usik Date: Mon, 18 Sep 2023 18:46:42 +0300 Subject: [PATCH 6/6] Method name and documentation have been modified --- README.md | 2 +- src/AuditConfiguration.php | 2 +- src/EventListener/CreateSchemaListener.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ebf225e3..de2839b4 100755 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ simple_things_entity_audit: entity_manager: custom ``` -If there is no need to create foreign keys for any reason, you can specify the corresponding parameter: +If you need to explicitly discard the foreign keys inferred from the audited entities, you can use the `disable_foreign_keys` parameter: ```yaml simple_things_entity_audit: disable_foreign_keys: true diff --git a/src/AuditConfiguration.php b/src/AuditConfiguration.php index 6f3984f9..9a4f8c68 100644 --- a/src/AuditConfiguration.php +++ b/src/AuditConfiguration.php @@ -81,7 +81,7 @@ public function getTableName(ClassMetadataInfo $metadata) return $this->getTablePrefix().$tableName.$this->getTableSuffix(); } - public function isDisabledForeignKeys(): bool + public function areForeignKeysDisabled(): bool { return $this->disableForeignKeys; } diff --git a/src/EventListener/CreateSchemaListener.php b/src/EventListener/CreateSchemaListener.php index 8ab70ae8..fbe5ea0d 100644 --- a/src/EventListener/CreateSchemaListener.php +++ b/src/EventListener/CreateSchemaListener.php @@ -119,7 +119,7 @@ public function postGenerateSchemaTable(GenerateSchemaTableEventArgs $eventArgs) } } - if (!$this->config->isDisabledForeignKeys()) { + if (!$this->config->areForeignKeysDisabled()) { $this->createForeignKeys($revisionTable, $revisionsTable); } }