PHPackages                             shoofly/doctrine-multi-schema-bundle - 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. shoofly/doctrine-multi-schema-bundle

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

shoofly/doctrine-multi-schema-bundle
====================================

Enables multiple schemas for Doctrine + Symfony

v0.1.6(8y ago)02.3k[1 issues](https://github.com/smcjones/doctrine-multi-schema-bundle/issues)MITPHPPHP &gt;=5.6.0

Since Apr 4Pushed 8y ago1 watchersCompare

[ Source](https://github.com/smcjones/doctrine-multi-schema-bundle)[ Packagist](https://packagist.org/packages/shoofly/doctrine-multi-schema-bundle)[ RSS](/packages/shoofly-doctrine-multi-schema-bundle/feed)WikiDiscussions master Synced 1mo ago

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

Enables Multiple Schemas for MySQL on Doctrine

*I created this bundle to fulfill a need for one of my projects. It is not thoroughly tested for all use cases, and will be regularly updated.*

*If you find this useful but spot a bug, I welcome PRs.*

The Premise
-----------

[](#the-premise)

Doctrine treats MySQL databases the same as PostgreSQL databases. The truth is that MySQL databases are closer in nature to a PostgreSQL schema, and the term `DATABASE` can be used interchangeably with `SCHEMA` in MySQL, [even in syntax](https://dev.mysql.com/doc/refman/5.7/en/create-database.html):

```
CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name ...

```

This makes it very difficult to handle MySQL layouts that use more than one schema - often a reality in inherited code.

If your personal use case is transferring an existing project with multiple schemas into a Symfony project, and you'd like to use Doctrine, then this bundle seeks to make that possible.

Installation
------------

[](#installation)

In your Symfony project, install with

```
composer require shoofly/doctrine-multi-schema-bundle

```

Add to your Symfony AppKernel.php:

```
$bundles = [
    new Shoofly\DoctrineMultiSchemaBundle\ShooflyDoctrineMultiSchemaBundle(),
];

```

Configuraiton
-------------

[](#configuraiton)

**IMPORTANT:** Remove your driver and platform, and replace it with these two parameters.

```
doctrine:
    dbal:
        driver_class: 'Shoofly\DoctrineMultiSchemaBundle\DBAL\MySQL\Driver'
        platform_service: "shoofly_doctrine_multi_schema.platform57"
        # for MySQL < 5.7, choose this:
        # platform_service: "shoofly_doctrine_multi_schema.platform"

```

Next, list the schemas you want to include in your ORM:

```
shoofly_doctrine_multi_schema:
    schemas:
        - foo
        - baz
        - bar

```

That should be the only configuration you need. If you run into any issues, please let me know.

Hope this helps someone else. If not, it's already helped me :)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~49 days

Recently: every ~62 days

Total

6

Last Release

3074d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/12f50abcfb74962dc37ce569f4405b554383ab5b756913f6c6ae69e5ceb626fa?d=identicon)[smcjones](/maintainers/smcjones)

---

Top Contributors

[![smcjones](https://avatars.githubusercontent.com/u/6015579?v=4)](https://github.com/smcjones "smcjones (5 commits)")

---

Tags

bundledbaldoctrinemysqlsymfonysymfony-bundlesymfonybundlemysqldoctrinedbal

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/shoofly-doctrine-multi-schema-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/shoofly-doctrine-multi-schema-bundle/health.svg)](https://phpackages.com/packages/shoofly-doctrine-multi-schema-bundle)
```

###  Alternatives

[fresh/doctrine-enum-bundle

Provides support of ENUM type for Doctrine2 in Symfony applications.

4636.8M12](/packages/fresh-doctrine-enum-bundle)[sonata-project/doctrine-orm-admin-bundle

Integrate Doctrine ORM into the SonataAdminBundle

46117.7M154](/packages/sonata-project-doctrine-orm-admin-bundle)[onurb/doctrine-yuml-bundle

Symfony Bundle to visualize the mapping of your entities with Yuml

4198.6k](/packages/onurb-doctrine-yuml-bundle)[vasek-purchart/doctrine-date-time-immutable-types-bundle

Bundle integration of Doctrine DateTimeImmutable types for Symfony

1085.6k](/packages/vasek-purchart-doctrine-date-time-immutable-types-bundle)[okapon/doctrine-set-type-bundle

Provides support of MySQL SET type for Doctrine2 in Symfony2 applications.

11159.0k](/packages/okapon-doctrine-set-type-bundle)

PHPackages © 2026

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