Closed bronte2k7 closed 2 years ago
@bronte2k7 yep, that's a missing feature of the migrations system, it applies unique constraint only on foreign keys automatically.
you can solve it quickly in the meantime defining it in the indexes:
class User(Model):
auto_validation = False
email = Field.string(
unique=True
)
indexes = {
'email_unique': {'fields': ['email'], 'unique': True}
}
model
migration generated
weppy 1.3.1 Python 3.6.7