fix: migrate does not recognise attribute changes for string primary key (#428)

* refactor: show warning for unsupported pk field changes

* fix: migrate does not recognise attribute changes for string primary key

* docs: update changelog

* refactor: reduce indents

* chore: update docs
This commit is contained in:
Waket Zheng
2025-02-27 22:23:26 +08:00
committed by GitHub
parent e299f8e1d6
commit a624d1b43b
5 changed files with 77 additions and 27 deletions

View File

@@ -79,6 +79,7 @@ class Category(Model):
class Product(Model):
id = fields.BigIntField(primary_key=True)
categories: fields.ManyToManyRelation[Category] = fields.ManyToManyField(
"models.Category", null=False
)
@@ -106,6 +107,7 @@ class Product(Model):
class Config(Model):
slug = fields.CharField(primary_key=True, max_length=20)
categories: fields.ManyToManyRelation[Category] = fields.ManyToManyField(
"models.Category", through="config_category_map", related_name="category_set"
)