Getting Flask-Migrate to Ignore SQL Views that are mapped as Flask-SQLAlchemy Models

荒凉一梦 提交于 2019-12-01 19:17:59

I think (though haven't tested) that you can mark your Table as a view with the __table_args__ attribute:

class ViewSampleView(db.Model):
    __tablename__ = 'vw_report_high_level_count'
    __table_args__ = {'info': dict(is_view=True)}

id = db.Column(db.String(), primary_key=True)
rowcount = db.Column(db.Integer(), nullable=False)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!