Skip to content

Commit

Permalink
bug #228 Fix Doctrine/Migrations configuration (Zales0123)
Browse files Browse the repository at this point in the history
This PR was merged into the 1.0-dev branch.

Discussion
----------

The same as Sylius/InvoicingPlugin#195

Without this change, migrations are generated into the plugin's directory rather than `src/Migrations`.

Commits
-------

fe0deaa Fix Doctrine/Migrations configuration
  • Loading branch information
GSadee authored Nov 13, 2020
2 parents 1489900 + fe0deaa commit 02d9399
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/DependencyInjection/SyliusRefundExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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', [
Expand Down
2 changes: 2 additions & 0 deletions tests/Application/config/packages/doctrine_migrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ doctrine_migrations:
storage:
table_storage:
table_name: sylius_migrations
migrations_paths:
'App\Migrations': '%kernel.project_dir%/src/Migrations/'

0 comments on commit 02d9399

Please sign in to comment.