You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
@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.
Bug Report
Running the
doctrine:mongodb:schema:update
command fails with errorIndex 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.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
doctrine:mongodb:schema:update
doctrine:mongodb:schema:update
Expected behavior
Drop the existing index, create a new one with the correct name.
The text was updated successfully, but these errors were encountered: