Skip to content

Commit

Permalink
Fixed migration failure while using external database. pgadmin-org#7556
Browse files Browse the repository at this point in the history
  • Loading branch information
anilsahoo20 committed Jun 17, 2024
1 parent c3d6f88 commit f0c48c8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions web/migrations/versions/ac2c2e27dc2d_.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.orm.session import Session
from pgadmin.model import Preferences
from pgadmin.model import db

# revision identifiers, used by Alembic.
revision = 'ac2c2e27dc2d'
Expand All @@ -19,9 +19,11 @@


def upgrade():
db.session.query(Preferences).filter(
session = Session(bind=op.get_bind())

session.query(Preferences).filter(
Preferences.name == 'execute_query').update({'name': 'execute_script'})
db.session.commit()
session.commit()

meta = sa.MetaData()
meta.reflect(op.get_bind(), only=('user_macros',))
Expand Down

0 comments on commit f0c48c8

Please sign in to comment.