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

fix(model): prevent index creation on syncIndexes if not necessary #12785

Merged
merged 2 commits into from Dec 16, 2022

Conversation

lpizzinidev
Copy link
Contributor

@lpizzinidev lpizzinidev commented Dec 9, 2022

fix #12250

Summary
The model.collection.createIndex is now executed only if there are indexes in the toCreate array.
getIndexesToCreate now includes a check to evaluate if the index was dropped. In that case, it will proceed to recreate it.

Copy link
Collaborator

@AbdelrahmanHafez AbdelrahmanHafez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the tests pass, LGTM. I'm kinda surprised that the fix is that simple.
Thanks @lpizzinidev :)

@vkarpov15 @Uzlopak Any idea why the tests didn't run here? 🤨

Copy link
Collaborator

@vkarpov15 vkarpov15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

@vkarpov15 vkarpov15 merged commit c86ed63 into Automattic:master Dec 16, 2022
@vkarpov15 vkarpov15 added this to the 6.8.1 milestone Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants