Skip to content

migrate does not recognise attribute changes for string primary key #370

Closed
@licongy

Description

@licongy

migrate does not recognise attribute changes for string primary key

for example:

If the original settings:

    id = fields.CharField(
        max_length=8,
        primary_key=True,
        generated=False,
        null=False, 
        unique=True,
    )

modify to:

    id = fields.CharField(
        max_length=16,       // changed here
        primary_key=True,
        generated=False,
        null=False, 
        unique=True,
    )

then aerich migrate will not find this change nor will it generate a migration file.
And the migration should also update the types of the corresponding fields of all established relationships at the same time.

aerich version:
0.8.0 103470f (installed with git+https://github.com/tortoise/aerich)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions