[DBAL-234] [DBAL-566] Add support for renaming indexes #473

Merged
merged 2 commits into from Dec 29, 2013

Conversation

Projects
None yet
7 participants
Member

deeky666 commented Dec 28, 2013

Currently renamed only indexes are scheduled for removal and recreation in the comparator. However recreating an index when only the name has changed is very inefficient on large tables as it internally requires a table recreation on most of the platforms. Many vendors offer a more efficient syntax for renaming indexes which saves the table recreation. This PR introduces this behaviour on capable platforms. Platforms that do not support this kind of syntax still use the current behaviour of dropping and recreating an index.
This PR also introduces the Table::renameIndex() method and the MySQL57Platform platform which adds support for explicitly renaming indexes.

Hello,

thank you for creating this pull request. I have automatically opened an issue
on our Jira Bug Tracker for you. See the issue link:

http://www.doctrine-project.org/jira/browse/DBAL-740

We use Jira to track the state of pull requests and the versions they got
included in.

Owner

beberlei commented Dec 29, 2013

Ok from me, just rebase and merge then please.

@deeky666 deeky666 added a commit that referenced this pull request Dec 29, 2013

@deeky666 deeky666 Merge pull request #473 from deeky666/DBAL-234
[DBAL-234] [DBAL-566] Add support for renaming indexes
6d0e8e2

@deeky666 deeky666 merged commit 6d0e8e2 into doctrine:master Dec 29, 2013

jsuggs commented Feb 6, 2014

I just upgraded and I'm not sure I completely agree with how this change works. I have an existing schema with custom index names and when I run the schema diff/update command it now suggests that I rename ALL of my custom indexes (even if I explicitly map them in annotations), thus rendering the Doctrine\ORM\Tools\Console\Command\SchemaTool\UpdateCommand useless.

Let me know if you need a more complete example/explanation, or if I need to create an issue.

Member

deeky666 commented Feb 6, 2014

@jsuggs Please create a ticket with more detailed information that helps debugging. I will then have a look at it. Thanks.

Strate commented Feb 6, 2014

@jsuggs this affected me too, please notify here as issue created.

Strate commented Feb 6, 2014

For postgresql, schema name is not prepended to index name

Member

deeky666 commented Feb 6, 2014

@jsuggs @Strate Please anyone create a ticket on JIRA. I need the SQL output from the UpdateCommand and preferably mapping information to analyze this issue. Thanks.

jsuggs commented Feb 7, 2014

@Strate and @deeky666 I've created this issue, and will add more information shortly: http://www.doctrine-project.org/jira/browse/DBAL-806

jsuggs commented Feb 7, 2014

@deeky666 please see https://github.com/jsuggs/schema-issue

@Strate please feel free to add to that repo.

Member

deeky666 commented Feb 7, 2014

Thank you for the detailled information. I will have a look at that
tomorrow and fix
Am 07.02.2014 20:25 schrieb "Jonathon Suggs" notifications@github.com:

@deeky666 please see https://github.com/jsuggs/schema-issue

@Strate please feel free to add to that repo.

Reply to this email directly or view it on GitHub.

It's possible to merge this fix in the 2.4 branch?
Can I help to do this merge? Can I do the changes and do a merge request in the 2.4 branch?

Owner

Ocramius commented Jun 26, 2014

@dudytz this is a new feature, it won't land in 2.4

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