Skip to content

Commit

Permalink
Merge pull request #477 from BitBagCommerce/feature/MUL-246-change-to…
Browse files Browse the repository at this point in the history
…-migrations-system

MUL-246 - adds migration for cms plugin, updates installation config
  • Loading branch information
senghe authored Nov 12, 2023
2 parents 34d1b7b + c95325f commit 032a3b2
Show file tree
Hide file tree
Showing 3 changed files with 153 additions and 2 deletions.
1 change: 0 additions & 1 deletion doc/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ you will probably need to change the extension of the imported file in

```
$ bin/console cache:clear
$ bin/console doctrine:migrations:diff
$ bin/console doctrine:migrations:migrate
$ bin/console assets:install --symlink
$ bin/console sylius:theme:assets:install --symlink
Expand Down
26 changes: 25 additions & 1 deletion src/DependencyInjection/BitBagSyliusCmsExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,36 @@

namespace BitBag\SyliusCmsPlugin\DependencyInjection;

use Sylius\Bundle\CoreBundle\DependencyInjection\PrependDoctrineMigrationsTrait;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\Extension;
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;

final class BitBagSyliusCmsExtension extends Extension
final class BitBagSyliusCmsExtension extends Extension implements PrependExtensionInterface
{
use PrependDoctrineMigrationsTrait;

public function load(array $configs, ContainerBuilder $container): void
{
}

public function prepend(ContainerBuilder $container): void
{
$this->prependDoctrineMigrations($container);
}

protected function getMigrationsNamespace(): string
{
return 'BitBag\SyliusCmsPlugin\Migrations';
}

protected function getMigrationsDirectory(): string
{
return '@BitBagSyliusCmsPlugin/Migrations';
}

protected function getNamespacesOfMigrationsExecutedBefore(): array
{
return ['Sylius\Bundle\CoreBundle\Migrations'];
}
}
Loading

0 comments on commit 032a3b2

Please sign in to comment.