-
-
Notifications
You must be signed in to change notification settings - Fork 390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a schema_provider option that enables the diff command for DBAL #1050
Conversation
tests/Doctrine/Migrations/Tests/Configuration/Migration/ArrayLoaderTest.php
Outdated
Show resolved
Hide resolved
The code looks good for me so far. For the feature itself @doctrine/team-migrations should take a look first. |
Hello. Thanks for working on this. IMO a schema provider should not be a configuration option but something passed to the dependency container. Having a callback as configuration value makes configuration non cache-able and impossible to express in XML, JSON or YAML. What about marking as public |
Actually looking better, things are "almost" working. $di->setService(SchemaProvider::class, $someSchemaProvider); will already do the job. |
@goetas : If you don't add it through configuration - it has this double way of configuring the tool. It needs proper documentation then. Shall I give the configuration of the dependency directly another try in this PR or do you want to discuss it first? |
Indeed it should be documented, I've added in the past how to provide custom entity managers but did not think on the possibility of providing only the schema provider (and I think it is a really good idea for doing so). I want to distinguish things that are configurations and things that are dependencies. Anything that can not be expressed in all the configuration formats (yaml, xml, json and php) can not go in the configurations pool. |
In 2.x, the configuration object was huge.... mainly because was managing both dependencies and configurations |
Ok, thanks for the side information! Will give it a try soon :) |
@goetas : I removed the configuration part. Where do you want me to document how to configure a custom schema provider? ( FYI : I've kept the entity manager public, since it would be a BC break. If you want to make it private, you can do it in another PR, so that this new feature can be released in a minor? ) |
Is there anything I can do in order to get this merged? Thanks! |
@veewee i'm sorry for the delay, I got some time back to look into this. Could you please rebase it? |
5d13b8f
to
e200ae3
Compare
e200ae3
to
68fb5b7
Compare
@goetas : rebased ;) |
I've changed the base branch for this to Can @SenseException or @greg0ire review this please? |
Thanks for your work |
Summary
This change makes it possible to configure a
schema_provider
that enables the diff command for doctrine DBAL as well.Currently the PR allows you to do:
In which,
MySchemaProvider
is aDoctrine\Migrations\Provider\SchemaProvider
.