Closed Maksim-Burtsev closed 1 year ago
Strange, can you show yourr models?
Is enough model where i made changes?
from src.core.utils.models import BaseModel
from tortoise import fields
IDENTIFYING_COMPANY_FIELDS = {'inn', 'ogrn'}
class Company(BaseModel):
COMPANY_TYPES = ("AB", "CD", "EF")
type = fields.CharField(20, default=COMPANY_TYPES[2])
sub_type = fields.CharField(max_length=255, null=True)
name_full = fields.CharField(max_length=255, null=True)
name_short = fields.CharField(max_length=255, null=True)
inn = fields.CharField(max_length=255, null=True)
ogrn = fields.CharField(max_length=255, null=True)
ogrn_data_reg = fields.DatetimeField(null=True)
director = fields.CharField(max_length=255, null=True)
email = fields.CharField(max_length=255, null=True)
legal_address = fields.CharField(max_length=255, null=True)
okopf = fields.CharField(max_length=255, null=True)
kpp = fields.CharField(max_length=255, null=True)
phone = fields.CharField(max_length=255, null=True)
Can confirm this happens. I changed type of a few columns from Int to Decimal, and for each column Aerich repeated ALTER TABLE ...
five times
fixed
Im change CharField to DateTime and use
aerich migrate
Migration file look like this:
I removed duplocate and successfully make
aerich upgrade
.Is it ok?