pgadmin4/web/migrations/versions/aff1436e3c8c_.py
Aditya Toshniwal 505a3ac960 1) Fixed cognitive complexity issues reported by SonarQube.
2) Fixed code smell 'Add a nested comment explaining why this method is
   empty, or complete the implementation'.
2020-07-24 11:46:30 +05:30

29 lines
643 B
Python

""" Update the default timeout to 10 seconds instead on 0.
0 indicates wait indefinitely which causes trouble when network connection
to server is lost.
Revision ID: aff1436e3c8c
Revises: a77a0932a568
Create Date: 2019-10-28 12:47:36.828709
"""
from pgadmin.model import db
# revision identifiers, used by Alembic.
revision = 'aff1436e3c8c'
down_revision = 'a77a0932a568'
branch_labels = None
depends_on = None
def upgrade():
db.engine.execute(
'UPDATE server SET connect_timeout=10 WHERE connect_timeout=0 OR connect_timeout IS NULL'
)
def downgrade():
# pgAdmin only upgrades, downgrade not implemented.
pass