Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
licongy opened this issue Dec 2, 2024 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@licongy
Copy link

licongy commented Dec 2, 2024

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)

@waketzheng
Copy link
Contributor

@licongy Thanks for the report. As described here: https://github.com/tortoise/aerich/blob/dev/aerich/migrate.py#L268,
fk field migrate only support rename.

@waketzheng waketzheng added the enhancement New feature or request label Dec 3, 2024
@licongy
Copy link
Author

licongy commented Dec 3, 2024

@licongy Thanks for the report. As described here: https://github.com/tortoise/aerich/blob/dev/aerich/migrate.py#L268, fk field migrate only support rename.

Got it, Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants