mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-10-12 16:11:59 -05:00
Fixed migration failure while using external database. #7556
This commit is contained in:
1 parent
1ba9f005a7
commit
3706c3126a
1 file changed
+5
-3
@@ -8,8 +8,8 @@ Create Date: 2024-05-17 19:35:03.700104
|
|||||||
"""
|
"""
|
||||||
from alembic import op
|
from alembic import op
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
|
from sqlalchemy.orm.session import Session
|
||||||
from pgadmin.model import Preferences
|
from pgadmin.model import Preferences
|
||||||
from pgadmin.model import db
|
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
# revision identifiers, used by Alembic.
|
||||||
revision = 'ac2c2e27dc2d'
|
revision = 'ac2c2e27dc2d'
|
||||||
@@ -19,9 +19,11 @@ depends_on = None
|
|||||||
|
|
||||||
|
|
||||||
def upgrade():
|
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'})
|
Preferences.name == 'execute_query').update({'name': 'execute_script'})
|
||||||
db.session.commit()
|
session.commit()
|
||||||
|
|
||||||
meta = sa.MetaData()
|
meta = sa.MetaData()
|
||||||
meta.reflect(op.get_bind(), only=('user_macros',))
|
meta.reflect(op.get_bind(), only=('user_macros',))
|
||||||
|
|||||||
Reference in new issue
Block a user