diff --git a/caravel/migrations/versions/d8bc074f7aad_add_new_field_is_restricted_to_.py b/caravel/migrations/versions/d8bc074f7aad_add_new_field_is_restricted_to_.py index 0de1a780ad881..127ee27e6845c 100644 --- a/caravel/migrations/versions/d8bc074f7aad_add_new_field_is_restricted_to_.py +++ b/caravel/migrations/versions/d8bc074f7aad_add_new_field_is_restricted_to_.py @@ -23,12 +23,11 @@ def upgrade(): bind = op.get_bind() session = db.Session(bind=bind) - session.query(models.DruidMetric).update({ - 'is_restricted': False - }) - session.query(models.SqlMetric).update({ - 'is_restricted': False - }) + for obj in session.query(models.DruidMetric).all(): + obj.is_restricted = False + + for obj in session.query(models.SqlMetric).all(): + obj.is_restricted = False session.commit() session.close()