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

@@ -40,6 +40,7 @@ class User(Model):
class Email(Model):
email = fields.CharField(max_length=200)
company = fields.CharField(max_length=100, db_index=True)
is_primary = fields.BooleanField(default=False)
user: fields.ForeignKeyRelation[User] = fields.ForeignKeyField(
"models.User", db_constraint=False