Skip to content

Allow services migrations - #19

Open
Jibbarth wants to merge 1 commit into
SyliusLabs:masterfrom
Jibbarth:feature/migration-service-factory
Open

Jibbarth wants to merge 1 commit into
SyliusLabs:masterfrom
Jibbarth:feature/migration-service-factory

Conversation

@Jibbarth

Copy link
Copy Markdown

Hi there 👋

I am migrating an old Sylius app from v1 to v2, upgrading also symfony to SF7.4.

During upgrade, I noticed that my old migrations raised an exception as the ContainerAwareInterface does not longer exist.

I tried to migrate migrations to services, enabling this in my doctrine_migration config

# config/packages/doctrine_migrations.yaml

doctrine_migrations:
    enable_service_migrations: true

It works well BUT it didn't see anymore any migration from sylius core and plugin.

The Factory added in the PR will automatically retrieve migration as service if registered with tag doctrine_migrations.migration, and if not retrieve any, fallback to the current factory.

It's allow to having some migration as service, and kept the whole migration discovery process from core/plugin working.

⚠️ This doesn't require enable_service_migrations in your config. If you leave it enabled, Doctrine Migrations will ignore the factory override and use its default service provider instead, so no core/plugin migration will be visible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant