Skip to content

Migrate call to IndexEditor API#12510

Open
greg0ire wants to merge 1 commit into
doctrine:3.6.xfrom
greg0ire:migrate-to-ie
Open

Migrate call to IndexEditor API#12510
greg0ire wants to merge 1 commit into
doctrine:3.6.xfrom
greg0ire:migrate-to-ie

Conversation

@greg0ire

@greg0ire greg0ire commented Jun 16, 2026

Copy link
Copy Markdown
Member

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:

-`quoted-name`
+"quoted-name"

@greg0ire greg0ire force-pushed the migrate-to-ie branch 2 times, most recently from 597f55f to 5cb4ca1 Compare June 16, 2026 06:46
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".

@morozov morozov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. An improperly formatted name like "name is successfully parsed by AbstractAsset but will fail to parse by the new parser.
  2. 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-name

I will fix it in the DBAL (the ORM logic will remain as proposed in the PR).

Comment thread src/Tools/SchemaTool.php
}

/** @phpstan-ignore method.notFound (IndexEditor::addToTable() is unreleased) */
$indexEditor->addToTable($table);

@morozov morozov Jun 16, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once table editing is migrated to TableEditor, this could be replaced with TableEditor::addIndex($indexEditor), but for now it looks like the right approach.

@greg0ire

Copy link
Copy Markdown
Member Author

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.

@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:

vendor/bin/phpunit
PHPUnit 11.5.55 by Sebastian Bergmann and contributors.

Runtime:       PHP 8.5.6
Configuration: /home/greg/dev/doctrine-orm/patch/phpunit.xml.dist

..............................................
Using DB driver Doctrine\DBAL\Logging\Driver
...............   61 / 3482 (  1%)
.............................................................  122 / 3482 (  3%)
.............................................................  183 / 3482 (  5%)
........................................................S....  244 / 3482 (  7%)
......................S.....DDDD...........D.................  305 / 3482 (  8%)
................DDDD.................D.D....S...D..D..DDD.DD.  366 / 3482 ( 10%)
SD.DD...DDDDDDD..........D...................................  427 / 3482 ( 12%)
...........................DDDD.DD................S.D.DD...D.  488 / 3482 ( 14%)
.......................................DDD...................  549 / 3482 ( 15%)
D....DD.D.DDDDDDDDDDDDD.......SSS.D.D.DD.DD..................  610 / 3482 ( 17%)
......D.............D........................................  671 / 3482 ( 19%)
...........................................D........DDDDDDDDD  732 / 3482 ( 21%)
DD.......DD.........DD.......................................  793 / 3482 ( 22%)
.............................................................  854 / 3482 ( 24%)
....D.SSS.............DDDDDDDDDD.............................  915 / 3482 ( 26%)
.............................................................  976 / 3482 ( 28%)
.......DDDDDDDD...............S.............................. 1037 / 3482 ( 29%)
.................................DSSSSSSSS................... 1098 / 3482 ( 31%)
..................D.......................................... 1159 / 3482 ( 33%)
............................................................S 1220 / 3482 ( 35%)
..............................DD.DD...................DDDDDDD 1281 / 3482 ( 36%)
DDDDD...DDDDD.DDDDDDDDDDDDD......DD.....D....DD.......DD....D 1342 / 3482 ( 38%)
.D.......DD..DDD..DD.DD.DSD..DDDD.DDDD.DDDD.DDDDDD.DSSSSDDDDD 1403 / 3482 ( 40%)
..DDDD.DS..DDDDD.DD..DDDDDDDDD..DDD....DDDDDDDDDDDDDDDDDDDDDD 1464 / 3482 ( 42%)
DDDD.DDDDDD.....DDDD......D.DDDDDDD...DS.DDDDDDDD.DDDDD...... 1525 / 3482 ( 43%)
S.DDDDDDDDDDDDD...DD.DDDDDD...SSSSSD..D...SS..DDDD....D...... 1586 / 3482 ( 45%)
.....D.DDDDSDD.DD.DDDDDDDDDDDDD.DDDDDD....DDDDDD..........SD. 1647 / 3482 ( 47%)
.DDDDD..D.D.D.DDDDD.DDDDDD.D.D.....D..D.DDDD.DDDD.DDD.DD.DDDD 1708 / 3482 ( 49%)
........................DDDDDDDDDDD.DDDDD.DD..DDDDDDDD..SS... 1769 / 3482 ( 50%)
....D........D......D.....D...............D.....D....D.D..... 1830 / 3482 ( 52%)
...D.....D....D....DDDDDDDDDDDDDD.....D...................... 1891 / 3482 ( 54%)
............................................................. 1952 / 3482 ( 56%)
............................................................. 2013 / 3482 ( 57%)
............................................................. 2074 / 3482 ( 59%)
............................................................. 2135 / 3482 ( 61%)
.................................S....S...................... 2196 / 3482 ( 63%)
............................................S................ 2257 / 3482 ( 64%)
............................................................. 2318 / 3482 ( 66%)
............................................................. 2379 / 3482 ( 68%)
...................................S...............SSS......I 2440 / 3482 ( 70%)
ISS.......................................................... 2501 / 3482 ( 71%)
.............................................SS.............. 2562 / 3482 ( 73%)
...................D........SSSS............................. 2623 / 3482 ( 75%)
............................................................. 2684 / 3482 ( 77%)
............................................................. 2745 / 3482 ( 78%)
............................................................. 2806 / 3482 ( 80%)
..S.......................................................... 2867 / 3482 ( 82%)
............................................................. 2928 / 3482 ( 84%)
.................................S........................... 2989 / 3482 ( 85%)
................................................S............ 3050 / 3482 ( 87%)
............................................................. 3111 / 3482 ( 89%)
............................................................. 3172 / 3482 ( 91%)
............................................................. 3233 / 3482 ( 92%)
............................................................. 3294 / 3482 ( 94%)
............DDSS.....................S....................... 3355 / 3482 ( 96%)
..........................................DDDDDDDDDDDDDDDDDDD 3416 / 3482 ( 98%)
D............................................................ 3477 / 3482 ( 99%)
.DDDD                                                         3482 / 3482 (100%)

Time: 00:04.284, Memory: 104.00 MB

2 things I don't like:

  • If we introduce a new configuration, this will look like a minor, and we are targeting a patch branch.
  • The changes are tricky, and I might be introducing some bugs, while patch releases are supposed to remove bugs.

Should we call Deprecation::ignoreDeprecations('https://github.com/doctrine/dbal/pull/7389'); in SchemaTool, then revert that on 3.7.x and address the deprecations on that branch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants