PHPackages                             k3progetti/multiple-database - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. k3progetti/multiple-database

ActiveSymfony-bundle[Database &amp; ORM](/categories/database)

k3progetti/multiple-database
============================

Symfony DoctrineMigrationsMultipleDatabaseBundle

v1.2.0(2y ago)062MITPHPPHP &gt;=7.2

Since Oct 6Pushed 2y agoCompare

[ Source](https://github.com/K3Progetti/multiple-database)[ Packagist](https://packagist.org/packages/k3progetti/multiple-database)[ RSS](/packages/k3progetti-multiple-database/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (9)Versions (14)Used By (0)

DoctrineMigrationsMultipleDatabaseBundle
========================================

[](#doctrinemigrationsmultipledatabasebundle)

This bundle extends the [DoctrineMigrationsBundle](https://github.com/doctrine/DoctrineMigrationsBundle) functionality in a hacky and dirty way to provide a easy way to configure migrations paths for multiple entity managers.

Configuration
-------------

[](#configuration)

- Install the package by running `composer require avaibooksports/doctrine-migrations-multiple-database-bundle`
- Go to your `config/bundles.php` file and register the bundle:

```
AvaiBookSports\Bundle\MigrationsMultipleDatabase\DoctrineMigrationsMultipleDatabaseBundle::class => ['all' => true],
```

- Finally, create a file in `config/packages/` called `doctrine_migrations_multiple_database.yaml` and follow the next example:

```
doctrine_migrations_multiple_database:
    entity_managers:
        default:
            migrations_paths:
                DoctrineMigrations\Main: '%kernel.project_dir%/migrations/Main'
        geonames:
            migrations_paths:
                DoctrineMigrations\Geonames: '%kernel.project_dir%/migrations/Geonames'
```

- You can leave your `doctirne_migrations.yaml` file untouched. Unmapped commands will fallback to that configuration, and if you need to disable this bundle everything should work as always.

Usage
-----

[](#usage)

Just call the same commands as always, with the same parameters. See the [supported commands](#supported-commands)

You can run a command for a specific entity manager adding the option `--em=example`

If you call any of the supported commands, they will work as always iterating over all the defined configurations.

For those commands who has a `--namespace` option, you have to provide always the correct entity manager. Otherwise, it will iterate over every entity manager, and will eventually fail. If you want to suggest a better workflow, please [open an issue](../../issues)!

### Supported configuration

[](#supported-configuration)

For now, all configuration parameters should work except `connection` and `em`, because we are already specifying which entity manager we want to connect.

This would be the [example configuration of DoctrineMigrationsBundle](https://symfony.com/doc/master/bundles/DoctrineMigrationsBundle/index.html#configuration) translated to this bundle:

```
# config/packages/doctrine_migrations_multiple_database.yaml

doctrine_migrations_multiple_database:
    entity_managers:
        default:
            # List of namespace/path pairs to search for migrations, at least one required
            migrations_paths:
                'App\Migrations': 'src/App'
                'AnotherApp\Migrations': '/path/to/other/migrations'
                'SomeBundle\Migrations': '@SomeBundle/Migrations'

            # List of additional migration classes to be loaded, optional
            migrations:
                - 'App\Migrations\Version123'
                - 'App\Migrations\Version123'

            storage:
                # Default (SQL table) metadata storage configuration
                table_storage:
                    table_name: 'doctrine_migration_versions'
                    version_column_name: 'version'
                    version_column_length: 1024
                    executed_at_column_name: 'executed_at'
                    execution_time_column_name: 'execution_time'

            # Possible values: "BY_YEAR", "BY_YEAR_AND_MONTH", false
            organize_migrations: false

            # Path to your custom migrations template
            custom_template: ~

            # Run all migrations in a transaction.
            all_or_nothing: false

            # Adds an extra check in the generated migrations to ensure that is executed on the same database type.
            check_database_platform: true

            services:
                # Custom migration sorting service id
                'Doctrine\Migrations\Version\Comparator': ~

                # Custom migration classes factory
                'Doctrine\Migrations\Version\MigrationFactory': ~

            factories:
                # Custom migration sorting service id via callables (MyCallableFactory must be a callable)
                'Doctrine\Migrations\Version\Comparator': 'MyCallableFactory'
```

### Supported commands

[](#supported-commands)

- `doctrine:migrations:current`
- `doctrine:migrations:diff`
- `doctrine:migrations:dump-schema`
- `doctrine:migrations:execute`
- `doctrine:migrations:generate`
- `doctrine:migrations:latest`
- `doctrine:migrations:list`
- `doctrine:migrations:migrate`
- `doctrine:migrations:rollup`
- `doctrine:migrations:status`
- `doctrine:migrations:sync-metadata-storage`
- `doctrine:migrations:up-to-date`
- `doctrine:migrations:version`

Pitfalls
--------

[](#pitfalls)

This package is being actively developed to satisfy a very specific scenario in our workflow, but we wanted to share this solution with more people struggling with this particular need.

As we are basing our configuration in YAML files, XML and PHP formats are not tested right now. We would love to have [feedback](../../issues) from you if you have any problems configuring the bundle. Unit tests should come sooner or later.

Also, we are supporting partially the configuration parameters, and not all commands are mapped.

All releases tagged like `0.x` will be affected by this pitfalls, and release `1.0` will cover a full configuration file and all commands.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 67.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~103 days

Recently: every ~96 days

Total

13

Last Release

805d ago

Major Versions

0.4.1 → v1.1.02024-01-31

PHP version history (3 changes)0.1PHP ^7.1

0.1.1PHP ^7.2

0.3.1PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/79fa54e3be2c0b9470fcb9c4acebe78b15470c37028e91694ce380ccf66f0ada?d=identicon)[mattiavitalik3](/maintainers/mattiavitalik3)

---

Top Contributors

[![devnix](https://avatars.githubusercontent.com/u/1777519?v=4)](https://github.com/devnix "devnix (23 commits)")[![PabloOntivero](https://avatars.githubusercontent.com/u/71698217?v=4)](https://github.com/PabloOntivero "PabloOntivero (4 commits)")[![thunderBestPower](https://avatars.githubusercontent.com/u/31736015?v=4)](https://github.com/thunderBestPower "thunderBestPower (4 commits)")[![IvoPereira](https://avatars.githubusercontent.com/u/1396475?v=4)](https://github.com/IvoPereira "IvoPereira (1 commits)")[![mhpcc](https://avatars.githubusercontent.com/u/50452722?v=4)](https://github.com/mhpcc "mhpcc (1 commits)")[![root-aza](https://avatars.githubusercontent.com/u/13816704?v=4)](https://github.com/root-aza "root-aza (1 commits)")

---

Tags

schemadbalmigrationsMultiple databases

###  Code Quality

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/k3progetti-multiple-database/health.svg)

```
[![Health](https://phpackages.com/badges/k3progetti-multiple-database/health.svg)](https://phpackages.com/packages/k3progetti-multiple-database)
```

###  Alternatives

[doctrine/doctrine-migrations-bundle

Symfony DoctrineMigrationsBundle

4.3k177.9M537](/packages/doctrine-doctrine-migrations-bundle)[doctrine/migrations

PHP Doctrine Migrations project offer additional functionality on top of the database abstraction layer (DBAL) for versioning your database schema and easily deploying changes to it. It is a very easy to use and a powerful tool.

4.8k204.8M440](/packages/doctrine-migrations)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[kimai/kimai

Kimai - Time Tracking

4.6k7.4k1](/packages/kimai-kimai)[fresh/doctrine-enum-bundle

Provides support of ENUM type for Doctrine2 in Symfony applications.

4636.8M12](/packages/fresh-doctrine-enum-bundle)[mnapoli/dbal-schema

DB schema manager for Doctrine DBAL

9732.9k1](/packages/mnapoli-dbal-schema)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
