fix 'superset db history' (#3948)
* fix 'superset db history' Related Error msg when running `superset db history`: "NameError: Can't invoke function 'get_bind', as the proxy object has not yet been established for the Alembic 'Operations' class. Try placing this code inside a callable." * Lint
This commit is contained in:
parent
34d6618b2e
commit
1ce14df43d
|
|
@ -34,11 +34,10 @@ datasources = sa.Table(
|
|||
sa.Column('datasource_name', sa.String(255)),
|
||||
)
|
||||
|
||||
bind = op.get_bind()
|
||||
insp = sa.engine.reflection.Inspector.from_engine(bind)
|
||||
|
||||
|
||||
def upgrade():
|
||||
bind = op.get_bind()
|
||||
insp = sa.engine.reflection.Inspector.from_engine(bind)
|
||||
|
||||
# Add the new less restrictive uniqueness constraint.
|
||||
with op.batch_alter_table('datasources', naming_convention=conv) as batch_op:
|
||||
|
|
@ -114,6 +113,8 @@ def upgrade():
|
|||
|
||||
|
||||
def downgrade():
|
||||
bind = op.get_bind()
|
||||
insp = sa.engine.reflection.Inspector.from_engine(bind)
|
||||
|
||||
# Add the new more restrictive uniqueness constraint which is required by
|
||||
# the foreign key constraints. Note this operation will fail if the
|
||||
|
|
|
|||
Loading…
Reference in New Issue