diff --git a/src/DependencyInjection/MonsieurBizSyliusCmsPageExtension.php b/src/DependencyInjection/MonsieurBizSyliusCmsPageExtension.php index 867e81f..081dcb6 100644 --- a/src/DependencyInjection/MonsieurBizSyliusCmsPageExtension.php +++ b/src/DependencyInjection/MonsieurBizSyliusCmsPageExtension.php @@ -16,9 +16,10 @@ use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Extension\Extension; +use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface; use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; -final class MonsieurBizSyliusCmsPageExtension extends Extension +final class MonsieurBizSyliusCmsPageExtension extends Extension implements PrependExtensionInterface { /** * {@inheritdoc} @@ -37,4 +38,17 @@ public function getAlias() { return str_replace('monsieur_biz', 'monsieurbiz', parent::getAlias()); } + + /** + * {@inheritdoc} + */ + public function prepend(ContainerBuilder $container): void + { + $doctrineConfig = $container->getExtensionConfig('doctrine_migrations'); + $container->prependExtensionConfig('doctrine_migrations', [ + 'migrations_paths' => array_merge(array_pop($doctrineConfig)['migrations_paths'] ?? [], [ + 'MonsieurBiz\SyliusCmsPagePlugin\Migrations' => '@MonsieurBizSyliusCmsPagePlugin/Migrations', + ]), + ]); + } } diff --git a/src/Resources/config/app/doctrine_migrations.yaml b/src/Resources/config/app/doctrine_migrations.yaml deleted file mode 100644 index 3d4dd12..0000000 --- a/src/Resources/config/app/doctrine_migrations.yaml +++ /dev/null @@ -1,3 +0,0 @@ -doctrine_migrations: - migrations_paths: - 'MonsieurBiz\SyliusCmsPagePlugin\Migrations': "@MonsieurBizSyliusCmsPagePlugin/Migrations" diff --git a/src/Resources/config/config.yaml b/src/Resources/config/config.yaml index a8ae9f6..8bb2eda 100644 --- a/src/Resources/config/config.yaml +++ b/src/Resources/config/config.yaml @@ -1,5 +1,4 @@ imports: - - { resource: 'app/doctrine_migrations.yaml' } - { resource: "sylius/resources.yaml" } - { resource: "sylius/grid.yaml" } - { resource: "sylius/fixtures.yaml" }