Migrate call to IndexEditor API#12510
Conversation
597f55f to
5cb4ca1
Compare
I had to relax a test that checked for the name of an index, which we do not really care about. What we really care about is that there is an index on the column named `quoted-name`. The name changes because the quoting changed from `quoted-name` to "quoted-name".
There was a problem hiding this comment.
Looks good with the only caveat: by invoking Parsers::parse*Name() when it's available, the ORM opts the user in to BC-breaking name parsing logic. See various deprecations in AbstractAsset::_setName(). Specifically:
- An improperly formatted name like
"nameis successfully parsed byAbstractAssetbut will fail to parse by the new parser. - An unquoted name with a dot is parsed differently in the old and the new implementations.
These and other changes in parsing behavior are covered with runtime depractions and tests, so look there for more details.
These compatibility concerns are theoretical but practically possible, so if we want to play it absolutely safe, we may need to add a configuration and allow ORM users to opt in.
The name changes because the quoting changed as follows:
-`quoted-name` +"quoted-name"
The change is actually expected but only partially: quotes should not be used to generate the name because they are syntax, not value. The expected change is:
-`quoted-name`
+quoted-nameI will fix it in the DBAL (the ORM logic will remain as proposed in the PR).
| } | ||
|
|
||
| /** @phpstan-ignore method.notFound (IndexEditor::addToTable() is unreleased) */ | ||
| $indexEditor->addToTable($table); |
There was a problem hiding this comment.
Once table editing is migrated to TableEditor, this could be replaced with TableEditor::addIndex($indexEditor), but for now it looks like the right approach.
@beberlei @derrabus @SenseException I need your opinion. We usually "fix" deprecations in patch releases, a sentiment I disagree with even though I opened doctrine/doctrine-website#485 Here, this patch is a tiny part of what's required to address all deprecations: 2 things I don't like:
Should we call |
I had to relax a test that checked for the name of an index, which we do
not really care about. What we really care about is that there is an
index on the column named
quoted-name.The name changes because the quoting changed as follows: