aerich icon indicating copy to clipboard operation
aerich copied to clipboard

Custom index error.

Open StepanGavrilov opened this issue 3 years ago • 1 comments

I create custom index (inherit from Index). if I am not declare index_name in my Index, i have error: AttributeError: 'UniqueIndexWithCondition' object has no attribute 'index_name'

if i declare a method index_name

def index_name(self, schema, model):
    pass

Creating a migrations with this at the beginning

-- upgrade --
DROP INDEX "None";

And have this error when trying to migrate tortoise.exceptions.OperationalError: index "None" does not exist

StepanGavrilov avatar Apr 14 '22 11:04 StepanGavrilov

index_name should return the index name

long2ice avatar Apr 14 '22 11:04 long2ice