From fe0deaa348e46a725969866ebc216484cb34467a Mon Sep 17 00:00:00 2001 From: Mateusz Zalewski Date: Fri, 13 Nov 2020 13:33:01 +0100 Subject: [PATCH] Fix Doctrine/Migrations configuration --- src/DependencyInjection/SyliusRefundExtension.php | 11 ++++++++--- .../config/packages/doctrine_migrations.yaml | 2 ++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/DependencyInjection/SyliusRefundExtension.php b/src/DependencyInjection/SyliusRefundExtension.php index ba7444269..ff418b7dd 100644 --- a/src/DependencyInjection/SyliusRefundExtension.php +++ b/src/DependencyInjection/SyliusRefundExtension.php @@ -29,10 +29,15 @@ public function prepend(ContainerBuilder $container): void return; } + $doctrineConfig = $container->getExtensionConfig('doctrine_migrations'); + $migrationsPath = (array) \array_pop($doctrineConfig)['migrations_paths']; $container->prependExtensionConfig('doctrine_migrations', [ - 'migrations_paths' => [ - 'Sylius\RefundPlugin\Migrations' => __DIR__ . '/../Migrations', - ], + 'migrations_paths' => \array_merge( + $migrationsPath ?? [], + [ + 'Sylius\RefundPlugin\Migrations' => '@SyliusRefundPlugin/Migrations', + ] + ), ]); $container->prependExtensionConfig('sylius_labs_doctrine_migrations_extra', [ diff --git a/tests/Application/config/packages/doctrine_migrations.yaml b/tests/Application/config/packages/doctrine_migrations.yaml index cdbc01ae7..08e83b8a8 100644 --- a/tests/Application/config/packages/doctrine_migrations.yaml +++ b/tests/Application/config/packages/doctrine_migrations.yaml @@ -2,3 +2,5 @@ doctrine_migrations: storage: table_storage: table_name: sylius_migrations + migrations_paths: + 'App\Migrations': '%kernel.project_dir%/src/Migrations/'