mirror of
https://github.com/apache/superset.git
synced 2024-09-12 08:39:45 -04:00
Fixing a potential FK error when doing bulk updates (#606)
I hit this upgrade issue in production where the FK for user wasn't allowing null. Perhaps it is specific to our environment but I'd rather fix this.
This commit is contained in:
parent
c58fd63efc
commit
1a4c7afbef
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user