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

Add __eq__ method for Indexinstances #2

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

fullonic
Copy link
Collaborator

@fullonic fullonic commented Jul 25, 2023

Fix tortoise#258

This issue happens because new_indexes.difference(old_indexes) [code] and old_indexes.difference(new_indexes) [code] returns always all indexes, even when they are equal.

This PR fixes this by adding the __eq__ to all Index instances. To ensure that indexes are equal we compare them using the __hash__ method.

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.

New migration file on migrate for Indexes defined on a Model.
1 participant