parameters:
    oro_migration.db_id_name_generator.class:            Oro\Bundle\MigrationBundle\Tools\DbIdentifierNameGenerator
    oro_migration.data_fixtures.loader.class:            Oro\Bundle\MigrationBundle\Migration\Loader\DataFixturesLoader
    oro_migration.migrations.loader.class:               Oro\Bundle\MigrationBundle\Migration\Loader\MigrationsLoader
    oro_migration.migrations.query_executor.class:       Oro\Bundle\MigrationBundle\Migration\MigrationQueryExecutor
    oro_migration.migrations.executor.class:             Oro\Bundle\MigrationBundle\Migration\MigrationExecutorWithNameGenerator
    oro_migration.migration.pre_up.listener.class:       Oro\Bundle\MigrationBundle\EventListener\PreUpMigrationListener
    oro_migration.migrations.extension_manager.class:    Oro\Bundle\MigrationBundle\Migration\MigrationExtensionManager
    oro_migration.migration.extension.rename.class:      Oro\Bundle\MigrationBundle\Migration\Extension\RenameExtension
    oro_migration.tools.schema_dumper.class:             Oro\Bundle\MigrationBundle\Tools\SchemaDumper
    oro_migration.twig.schema_dumper.class:              Oro\Bundle\MigrationBundle\Twig\SchemaDumperExtension
    oro_migration.migration.extension.data_storage.class: Oro\Bundle\MigrationBundle\Migration\Extension\DataStorageExtension
services:
    oro_migration.db_id_name_generator:
        class: %oro_migration.db_id_name_generator.class%

    oro_migration.data_fixtures.loader:
        class: %oro_migration.data_fixtures.loader.class%
        arguments:
            - '@doctrine.orm.entity_manager'
            - '@service_container'

    oro_migration.migrations.loader:
        class: %oro_migration.migrations.loader.class%
        arguments:
            - '@kernel'
            - '@doctrine.dbal.default_connection'
            - '@service_container'
            - '@event_dispatcher'

    oro_migration.migrations.query_executor:
        class: %oro_migration.migrations.query_executor.class%
        arguments:
            - '@doctrine.dbal.default_connection'

    oro_migration.migrations.executor:
        class: %oro_migration.migrations.executor.class%
        arguments:
            - '@oro_migration.migrations.query_executor'
            - '@oro_cache.oro_data_cache_manager'
        calls:
            - [setExtensionManager, ['@oro_migration.migrations.extension_manager']]
            - [setNameGenerator, ['@oro_migration.db_id_name_generator']]

    oro_migration.migration.pre_up.listener:
        class: %oro_migration.migration.pre_up.listener.class%
        tags:
            - { name: kernel.event_listener, event: oro_migration.pre_up, method: onPreUp }

    oro_migration.migrations.extension_manager:
        class: %oro_migration.migrations.extension_manager.class%

    oro_migration.migration.extension.rename:
        class: %oro_migration.migration.extension.rename.class%
        tags:
            - { name: oro_migration.extension, extension_name: rename }

    oro_migration.migration.extension.data_storage:
        class: %oro_migration.migration.extension.data_storage.class%
        tags:
            - { name: oro_migration.extension, extension_name: data_store }

    oro_migration.tools.schema_dumper:
        class: %oro_migration.tools.schema_dumper.class%
        arguments:
            - '@twig'
        lazy: true

    oro_migration.twig.schema_dumper:
        class: %oro_migration.twig.schema_dumper.class%
        arguments:
            - '@doctrine'
        tags:
            - { name: twig.extension }

    oro_migration.listener.console_command_listener:
        class: Oro\Bundle\MigrationBundle\EventListener\ConsoleCommandListener
        tags:
            - { name: kernel.event_listener, event: console.command, method: onConsoleCommand }
