-
-
Notifications
You must be signed in to change notification settings - Fork 388
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
Allow alternative connection/entity-manager via --em or --conn option #1023
Conversation
goetas
commented
Jun 25, 2020
•
edited
Loading
edited
Q | A |
---|---|
Type | bug/feature/improvement |
BC Break | no |
Fixed issues | #1021 doctrine/DoctrineMigrationsBundle#341 |
11010c3
to
aea58d2
Compare
lib/Doctrine/Migrations/Tools/Console/Command/DoctrineCommand.php
Outdated
Show resolved
Hide resolved
lib/Doctrine/Migrations/Tools/Console/Command/DoctrineCommand.php
Outdated
Show resolved
Hide resolved
lib/Doctrine/Migrations/Tools/Console/Command/DoctrineCommand.php
Outdated
Show resolved
Hide resolved
lib/Doctrine/Migrations/Tools/Console/Command/DoctrineCommand.php
Outdated
Show resolved
Hide resolved
lib/Doctrine/Migrations/Tools/Console/Command/DoctrineCommand.php
Outdated
Show resolved
Hide resolved
lib/Doctrine/Migrations/Tools/Console/Command/DoctrineCommand.php
Outdated
Show resolved
Hide resolved
lib/Doctrine/Migrations/Tools/Console/Command/DoctrineCommand.php
Outdated
Show resolved
Hide resolved
lib/Doctrine/Migrations/Tools/Console/Command/DoctrineCommand.php
Outdated
Show resolved
Hide resolved
Note for my self: there should be also a config parameter in the configurations allowing you to choose the entity manager or the connection |
78299d3
to
3f17e20
Compare
It is very important feature for me. |
lib/Doctrine/Migrations/Tools/Console/Command/DoctrineCommand.php
Outdated
Show resolved
Hide resolved
lib/Doctrine/Migrations/Tools/Console/Command/DoctrineCommand.php
Outdated
Show resolved
Hide resolved
Yeah, ideally the connection |
I guess it's not backward compatible, but |
Hmm... that is a good point... (in reality that makes it confusing, |
With 9f75d67 i have refactored how connections are loaded. The biggest change is the following: before /**
* @internal
*/
interface ConnectionLoader
{
public function getConnection() : Connection;
} after interface ConnectionLoader
{
public function getConnection(?string $name = null) : Connection;
} The change is not backward compatible, but given:
I think that we could discuss the possibility to release it as 3.1 instead of making a new major release just for this change. What do you think? |
If the changed API was marked as |
I guess this is a fitting change for the interface.
Should the interface stay |
to be honest i got lost and i did not notice that was marked as
I think not, if ppl have weird connection setups, that interface is the way how they can provide the connection to the library. It seems that both of you agree with proceeding with this, I will update tests and documentation by using the currently proposed approach. |
It looks like it. |
9a8543d
to
27bfcd6
Compare
27bfcd6
to
008d9ed
Compare
After a lot of work, this is ready for review! |
008d9ed
to
1b0ff32
Compare
lib/Doctrine/Migrations/Tools/Console/Command/DoctrineCommand.php
Outdated
Show resolved
Hide resolved
1b0ff32
to
27248a8
Compare
@andrew-demb @greg0ire You are right, i somehow missed that. Thanks! |
27248a8
to
a83b35f
Compare
lib/Doctrine/Migrations/Configuration/Connection/Exception/InvalidConfiguration.php
Outdated
Show resolved
Hide resolved
lib/Doctrine/Migrations/Configuration/EntityManager/Exception/InvalidConfiguration.php
Outdated
Show resolved
Hide resolved
lib/Doctrine/Migrations/Configuration/Exception/InvalidLoader.php
Outdated
Show resolved
Hide resolved
lib/Doctrine/Migrations/Configuration/Migration/ConfigurationArray.php
Outdated
Show resolved
Hide resolved
26a9a72
to
107a313
Compare
All suggestions have been applied. |
tests/Doctrine/Migrations/Tests/DependencyFactoryWithEntityManagerRegistryTest.php
Outdated
Show resolved
Hide resolved
tests/Doctrine/Migrations/Tests/DependencyFactoryWithEntityManagerRegistryTest.php
Outdated
Show resolved
Hide resolved
Co-authored-by: Grégoire Paris <[email protected]>