-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Conversation
Hello, thank you for creating this pull request. I have automatically opened an issue http://www.doctrine-project.org/jira/browse/DBAL-740 We use Jira to track the state of pull requests and the versions they got |
Ok from me, just rebase and merge then please. |
[DBAL-234] [DBAL-566] Add support for renaming indexes
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 Let me know if you need a more complete example/explanation, or if I need to create an issue. |
@jsuggs Please create a ticket with more detailed information that helps debugging. I will then have a look at it. Thanks. |
@jsuggs this affected me too, please notify here as issue created. |
For postgresql, schema name is not prepended to index name |
@Strate and @deeky666 I've created this issue, and will add more information shortly: http://www.doctrine-project.org/jira/browse/DBAL-806 |
@deeky666 please see https://github.com/jsuggs/schema-issue @Strate please feel free to add to that repo. |
Thank you for the detailled information. I will have a look at that
|
Another issue: http://www.doctrine-project.org/jira/browse/DBAL-807 |
It's possible to merge this fix in the 2.4 branch? |
@Dudytz this is a new feature, it won't land in 2.4 |
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 theMySQL57Platform
platform which adds support for explicitly renaming indexes.