aerich icon indicating copy to clipboard operation
aerich copied to clipboard

Add `__eq__` method for `Index` instances

Open fullonic opened this issue 2 years ago • 0 comments

Fix https://github.com/tortoise/aerich/issues/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.

fullonic avatar Jul 26 '23 07:07 fullonic