You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When deleting a field with unqiue=True it will raise KeyError.
To Reproduce
version:
mysql8.0,tortoise-orm branch is develop(version 905daaa53928622b53454f65fd629690a7e5491f),aerich branch is dev(version 15d5612)
Steps to Reproduction:
1.This is my model
class Tasks(Model):
"""任务表"""
id = fields.IntField(pk=True)
name = fields.CharField(max_length=100, unique=True, description="任务名称")
status = fields.IntEnumField(enum_type=TaskStatus, description="任务状态")
class Meta:
table = "tb_tasks"
class Tasks(Model):
"""任务表"""
id = fields.IntField(pk=True)
status = fields.IntEnumField(enum_type=TaskStatus, description="任务状态")
class Meta:
table = "tb_tasks"
4.Migrate and upgrade
aerich migrate
aerich upgrade
5.It will raise a exception KeyError: 'name'
The text was updated successfully, but these errors were encountered:
Describe the bug
When deleting a field with unqiue=True it will raise KeyError.
To Reproduce
version:
mysql8.0,tortoise-orm branch is develop(version 905daaa53928622b53454f65fd629690a7e5491f),aerich branch is dev(version 15d5612)
Steps to Reproduction:
1.This is my model
2.Init db
3.Delete the name field of the model from step 2
4.Migrate and upgrade
5.It will raise a exception
KeyError: 'name'
The text was updated successfully, but these errors were encountered: