-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Make column and index renaming configurable #6300
base: 4.2.x
Are you sure you want to change the base?
Conversation
b663bfe
to
d0c8602
Compare
There hasn't been any activity on this pull request in the past 90 days, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days. |
I adressed all review comments. Adressing this issue is quite important for us in order to get compatible with Doctrine 4. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this lacks documentation, and I'm curious to see what a real-world usage would look like, since "The comparator can be only instantiated by a schema manager" (so, at runtime, rather than at DIC compilation time).
Should I add a section for
We would use it here: https://github.com/contao/contao/blob/aa54c3df007e4b01b73e08036e35c054a7d1fd84/core-bundle/src/Migration/CommandCompiler.php#L61-L66 like this: $comparator = $schemaManager->createComparator();
$config = new ComparatorConfig();
$config->setDetectRenamedColumns(false);
$config->setDetectRenamedIndexes(false);
$comparator->setConfig($config);
$diffCommands = $comparator
->compareSchemas($fromSchema, $toSchema)
->toSql($this->connection->getDatabasePlatform())
; Are you happy with the |
I would drop |
Should I make the |
I think everything should be made immutable by default, yes. If people need to mutate anything, they will send a PR explaining their use case, making it mutable won't be a breaking change. |
A section feels enough |
Done in e117bbb |
dd9bc52
to
b4195ae
Compare
Failing CI seems to be unrelated. |
# Conflicts: # src/Schema/Comparator.php
As this didn’t make it into the 4.1.0 release, should I change the base branch to 4.2.x? |
Done. And please rebase your PR and fix the red CI checks. |
Done. |
Only the “Upload coverage to Codecov” job fails now. I’m not sure how to fix that. |
5b4f358
to
c47b6ba
Compare
You can ignore that one. |
c47b6ba
to
05ad0d8
Compare
This looks quite similar to what I've just done in #6521 - I've injected the Configuration where you inject this new config class of yours. However, I'm curious as to how I would configure this at the end-user-level? The doctrine-bundle configures the Configuration, so it would be easy enough to add new options there. But how will this work on your class? In my symfony project I see several places outside the dbal that call I'm fine with having a dedicated config sub-class for the comparator, but would it not make sense to have it also as property on the Configuration, and then inject it from there, rather via an argument of |
Summary
Makes column and index rename detection of the
Comparator
configurable, as suggested in #6299 (comment)