我尝试在一些表中添加新的列,在sqlalchemy-migrate文档中有这样的描述:
col = Column('col1', String, default='foobar')
col.create(table, populate_default=True)但是我得到了错误,我认为这是因为我使用了声明性模型,我如何使用迁移?
发布于 2011-10-12 21:36:04
def upgrade(migrate_engine):
Base.metadata.bind = migrate_engine
col = Column('col1', String, default='foobar')
col.create(table, populate_default=True)`对我很管用。
https://stackoverflow.com/questions/6707371
复制相似问题