Download the PHP package avaibooksports/doctrine-migrations-multiple-database-bundle without Composer
On this page you can find all versions of the php package avaibooksports/doctrine-migrations-multiple-database-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download avaibooksports/doctrine-migrations-multiple-database-bundle
More information about avaibooksports/doctrine-migrations-multiple-database-bundle
Files in avaibooksports/doctrine-migrations-multiple-database-bundle
Package doctrine-migrations-multiple-database-bundle
Short Description Symfony DoctrineMigrationsMultipleDatabaseBundle
License MIT
Informations about the package doctrine-migrations-multiple-database-bundle
DoctrineMigrationsMultipleDatabaseBundle
This bundle extends the DoctrineMigrationsBundle functionality in a hacky and dirty way to provide a easy way to configure migrations paths for multiple entity managers.
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: -
Finally, create a file in
config/packages/
calleddoctrine_migrations_multiple_database.yaml
and follow the next example: - 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
Just call the same commands as always, with the same parameters. See the 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!
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 translated to this bundle:
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
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 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.
All versions of doctrine-migrations-multiple-database-bundle with dependencies
doctrine/migrations Version ~3.0
php Version >=7.2
symfony/framework-bundle Version ~3.4|~4.0|~5.0|~6.0
doctrine/doctrine-migrations-bundle Version ^3