Fix create/drop indexes in every migration (#377)
* Add `__eq__` method for `Index`instances * tests: add Index test case * refactor: compare index instances before set hash and eq func to class * fix: sort fields when generating index hash * docs: update changlog * fix style issue * refactor: use CustomIndex instead of postgres special HashIndex * Check tortoise version before patch Index * Add comment * Add comment for why > work --------- Co-authored-by: dbf <somnium@riseup.net>
This commit is contained in:
7
tests/indexes.py
Normal file
7
tests/indexes.py
Normal file
@@ -0,0 +1,7 @@
|
||||
from tortoise.indexes import Index
|
||||
|
||||
|
||||
class CustomIndex(Index):
|
||||
def __init__(self, *args, **kw) -> None:
|
||||
super().__init__(*args, **kw)
|
||||
self._foo = ""
|
||||
Reference in New Issue
Block a user