在我的models.py文件中有这样一个类:
class DepartmentCategory(Enum):
"""The various categories of departments"""
committee = 'Committee'
subcommittee = 'Subcommittee'在我的表单的选择字段中使用的。所有的工作都很好,但是当我向Enum类添加一个新值时,例如:
class DepartmentCategory(Enum):
"""The various categories of departments"""
general = 'General'
committee = 'Committee'
subcommittee = 'Subcommittee'保存新值,数据库失败,终端和浏览器都不显示错误。我已经多次迁移(flask db迁移)和升级(flask db升级)我的数据库,但问题没有解决。请帮帮忙。
发布于 2018-11-21 01:56:35
您需要迁移数据库定义,例如使用https://pypi.org/project/alembic/
https://stackoverflow.com/questions/53396382
复制相似问题