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

Update indexes fails if there already exists same index with different name. #2224

Open
endrsmar opened this issue Sep 30, 2020 · 2 comments
Assignees
Labels
Projects

Comments

@endrsmar
Copy link

Bug Report

Running the doctrine:mongodb:schema:update command fails with error Index with name: <index_name> already exists with a different name if there already exists an index with same keys and options but different name on the collection.

Q A
BC Break yes
Version 2.1.2

Summary

Because name of an index is ignored when checking if index should be dropped in SchemaManager (PR #2114) and because mongodb prevets creating duplicate indexes with different names, running schema update after renaming index can lead to failure.

Current behavior

Schema update fails with Index with name: <index_name> already exists with a different name.

How to reproduce

  • Create entity mapping with an index
  • run doctrine:mongodb:schema:update
  • rename the index in the mapping
  • run doctrine:mongodb:schema:update

Expected behavior

Drop the existing index, create a new one with the correct name.

@stale
Copy link

stale bot commented Oct 31, 2020

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale Issues that have not seen any activity in 30 days label Oct 31, 2020
@malarzm malarzm removed the Stale Issues that have not seen any activity in 30 days label Nov 3, 2020
@malarzm malarzm added this to the 2.1.3 milestone Nov 3, 2020
@malarzm malarzm added this to 2.1 (bug fixes only) in Roadmap Nov 3, 2020
@malarzm malarzm added the Bug label Nov 3, 2020
@malarzm
Copy link
Member

malarzm commented Nov 3, 2020

@endrsmar thanks for the report! As you can see we are currently struggling with time we can devote to ODM so would you like to work a on fix for your problem? I can offer my help on our Slack's #mongodb-odm channel but otherwise I don't know when I'll be able to look into the fixing the issue personally.

@malarzm malarzm modified the milestones: 2.1.3, 2.1.4 Dec 20, 2020
@alcaeus alcaeus self-assigned this Jan 12, 2021
@alcaeus alcaeus modified the milestones: 2.1.4, 2.2.1 Jan 19, 2021
@alcaeus alcaeus removed this from the 2.2.1 milestone May 15, 2021
@alcaeus alcaeus moved this from 2.1 (unsupported) to 2.x (future scope) in Roadmap May 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Roadmap
2.x (future scope)
Development

No branches or pull requests

3 participants