fix: no migration occurs when adding unique true to indexed field (#414)

* feat: alter unique for indexed column

* chore: update docs and change some var names
This commit is contained in:
Waket Zheng
2025-02-20 16:58:32 +08:00
committed by GitHub
parent c35282c2a3
commit 41df464e8b
9 changed files with 130 additions and 34 deletions

View File

@@ -49,6 +49,7 @@ class User(Model):
class Email(Model):
email_id = fields.IntField(primary_key=True)
email = fields.CharField(max_length=200, db_index=True)
company = fields.CharField(max_length=100, db_index=True, unique=True)
is_primary = fields.BooleanField(default=False)
address = fields.CharField(max_length=200)
users: fields.ManyToManyRelation[User] = fields.ManyToManyField("models.User")