Skip to content
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

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

Merged
merged 2 commits into from
Dec 29, 2013

Conversation

deeky666
Copy link
Member

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.

@doctrinebot
Copy link

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.

@beberlei
Copy link
Member

Ok from me, just rebase and merge then please.

deeky666 added a commit that referenced this pull request Dec 29, 2013
[DBAL-234] [DBAL-566] Add support for renaming indexes
@deeky666 deeky666 merged commit 6d0e8e2 into doctrine:master Dec 29, 2013
@jsuggs
Copy link

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.

@deeky666
Copy link
Member Author

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
Copy link

Strate commented Feb 6, 2014

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

@Strate
Copy link

Strate commented Feb 6, 2014

For postgresql, schema name is not prepended to index name

@deeky666
Copy link
Member Author

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
Copy link

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
Copy link

jsuggs commented Feb 7, 2014

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

@Strate please feel free to add to that repo.

@deeky666
Copy link
Member Author

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.

@Strate
Copy link

Strate commented Feb 8, 2014

@leggiero
Copy link

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?

@Ocramius
Copy link
Member

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants