tortoise / aerich

A database migrations tool for TortoiseORM, ready to production.
https://github.com/tortoise/aerich
Apache License 2.0
808 stars 91 forks source link

Custom index error. #239

Open StepanGavrilov opened 2 years ago

StepanGavrilov commented 2 years ago

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

long2ice commented 2 years ago

index_name should return the index name