1) Fixed an issue where Query history is not getting loaded with an external database. #5781

2) Change the datatype of the value column of the setting table to text instead of a string. #5746
3) Fixed an issue where the key 'passfile' is not found. #4728
This commit is contained in:
Akshay Joshi 2023-01-30 15:38:36 +05:30
parent fd1c26408b
commit ea3dffe78d
5 changed files with 15 additions and 7 deletions

View File

@ -32,3 +32,4 @@ Bug fixes
| `Issue #5732 <https://github.com/pgadmin-org/pgadmin4/issues/5732>`_ - Fixed an issue where Kerberos authentication to the server is not imported/exported. | `Issue #5732 <https://github.com/pgadmin-org/pgadmin4/issues/5732>`_ - Fixed an issue where Kerberos authentication to the server is not imported/exported.
| `Issue #5751 <https://github.com/pgadmin-org/pgadmin4/issues/5751>`_ - Fix failing import servers CLI due to vulnerability fix. | `Issue #5751 <https://github.com/pgadmin-org/pgadmin4/issues/5751>`_ - Fix failing import servers CLI due to vulnerability fix.
| `Issue #5746 <https://github.com/pgadmin-org/pgadmin4/issues/5746>`_ - Increase the length of the value column of the setting table. | `Issue #5746 <https://github.com/pgadmin-org/pgadmin4/issues/5746>`_ - Increase the length of the value column of the setting table.
| `Issue #5781 <https://github.com/pgadmin-org/pgadmin4/issues/5781>`_ - Fixed an issue where Query history is not getting loaded with external database.

View File

@ -67,10 +67,15 @@ def migrate_connection_params(table_name):
.values(connection_params=connection_params) .values(connection_params=connection_params)
) )
# Drop constraint on ssl_mode column.
try:
with op.batch_alter_table(table_name) as batch_op:
batch_op.drop_constraint('ck_ssl_mode')
except Exception:
pass
# Drop unused columns # Drop unused columns
with op.batch_alter_table(table_name) as batch_op: with op.batch_alter_table(table_name) as batch_op:
if table_name == 'server':
batch_op.drop_constraint('ck_ssl_mode')
batch_op.drop_column('ssl_mode') batch_op.drop_column('ssl_mode')
batch_op.drop_column('sslcert') batch_op.drop_column('sslcert')
batch_op.drop_column('sslkey') batch_op.drop_column('sslkey')
@ -90,8 +95,8 @@ def upgrade():
with op.batch_alter_table("setting") as batch_op: with op.batch_alter_table("setting") as batch_op:
batch_op.alter_column('value', batch_op.alter_column('value',
existing_type=sa.String(length=1024), existing_type=sa.String(length=1024),
type_=sa.String(length=2048), type_=sa.Text(),
existing_nullable=False) postgresql_using='value::text')
def downgrade(): def downgrade():

View File

@ -388,6 +388,8 @@ def create_app(app_name=None):
db_upgrade(app) db_upgrade(app)
os.environ['CORRUPTED_DB_BACKUP_FILE'] = '' os.environ['CORRUPTED_DB_BACKUP_FILE'] = ''
except Exception: except Exception:
app.logger.error('Database migration failed')
app.logger.error(traceback.format_exc())
backup_db_file() backup_db_file()
# check all tables are present in the db. # check all tables are present in the db.

View File

@ -1147,7 +1147,7 @@ class ServerNode(PGChildNodeView):
password = encrypt(password, crypt_key) password = encrypt(password, crypt_key)
elif 'passfile' in data['connection_params'] and \ elif 'passfile' in data['connection_params'] and \
data['connection_params']['passfile'] != '': data['connection_params']['passfile'] != '':
passfile = data['passfile'] passfile = data['connection_params']['passfile']
if 'tunnel_password' in data and data["tunnel_password"] != '': if 'tunnel_password' in data and data["tunnel_password"] != '':
have_tunnel_password = True have_tunnel_password = True

View File

@ -132,7 +132,7 @@ class Setting(db.Model):
__tablename__ = 'setting' __tablename__ = 'setting'
user_id = db.Column(db.Integer, db.ForeignKey(USER_ID), primary_key=True) user_id = db.Column(db.Integer, db.ForeignKey(USER_ID), primary_key=True)
setting = db.Column(db.String(256), primary_key=True) setting = db.Column(db.String(256), primary_key=True)
value = db.Column(db.String(1024)) value = db.Column(db.Text())
class ServerGroup(db.Model): class ServerGroup(db.Model):
@ -371,7 +371,7 @@ class QueryHistoryModel(db.Model):
db.Integer(), db.ForeignKey(SERVER_ID), nullable=False, db.Integer(), db.ForeignKey(SERVER_ID), nullable=False,
primary_key=True) primary_key=True)
dbname = db.Column(db.String(), nullable=False, primary_key=True) dbname = db.Column(db.String(), nullable=False, primary_key=True)
query_info = db.Column(db.String(), nullable=False) query_info = db.Column(PgAdminDbBinaryString(), nullable=False)
last_updated_flag = db.Column(db.String(), nullable=False) last_updated_flag = db.Column(db.String(), nullable=False)