Allow setting custom username for shared servers, with default as username of server being shared. #6229

This commit is contained in:
Aditya Toshniwal
2023-10-11 12:56:06 +05:30
committed by GitHub
parent 4450145d31
commit fc411bfc49
9 changed files with 90 additions and 36 deletions

View File

@@ -0,0 +1,41 @@
##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2023, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
##########################################################################
""" Add the new column for shared server username and change
autoincrement in server table
Revision ID: 9426ad06a63b
Revises: f656e56dfdc8
Create Date: 2023-10-09 15:09:50.773035
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '9426ad06a63b'
down_revision = 'f656e56dfdc8'
branch_labels = None
depends_on = None
def upgrade():
# Added sqlite_autoincrement to force sqlite use auto increment instead of
# last row id for next record. For future server table changes, we need to
# add table_kwargs={'sqlite_autoincrement': True} as a param to
# batch_alter_table
with op.batch_alter_table(
"server", table_kwargs={'sqlite_autoincrement': True}) as batch_op:
batch_op.alter_column('id', autoincrement=True)
batch_op.add_column(sa.Column('shared_username', sa.String(64), nullable=True))
def downgrade():
# pgAdmin only upgrades, downgrade not implemented.
pass