def upgrade():
    bind = op.get_bind()
    op.add_column('tables', sa.Column('is_sqllab_view', sa.Boolean(), nullable=True, default=False, server_default=sa.false()))
    session = db.Session(bind=bind)
    for tbl in session.query(Table).all():
        if tbl.sql:
            tbl.is_sqllab_view = True
    session.commit()
    db.session.close()
def upgrade():
    bind = op.get_bind()
    op.add_column('tables', sa.Column('is_sqllab_view', sa.Boolean(), nullable=True, default=False, server_default=sa.false()))
    session = db.Session(bind=bind)
    for tbl in session.query(Table).all():
        if tbl.sql:
            tbl.is_sqllab_view = True
    session.commit()
    db.session.close()