【发布时间】:2018-12-29 18:21:14
【问题描述】:
我有一个数据库升级迁移要应用到数据库列:
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('details') as batch_op:
batch_op.alter_column('details', 'non_essential_cookies',
existing_type=sa.BOOLEAN(),
nullable=False)
# ### end Alembic commands ###
我正在实施批处理模式,因为不支持 ALTER,之前我收到此错误:sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) near "ALTER":。但是,我希望批处理模式可以工作,但现在我收到了新错误:
TypeError: <flask_script.commands.Command object at 0x1149bb278>: alter_column() got multiple values for argument 'nullable'.
我表中只有一个元组,相关属性不为NULL,所以数据库迁移是有效的。我只是不明白为什么会有多个值
【问题讨论】:
标签: database sqlalchemy alembic