Upgrade ID column in the database table to BigInteger to support large OID values. #9223

pull/9529/head
Yogesh Mahajan 2026-01-08 18:38:02 +05:30 committed by GitHub
parent a9d56402a1
commit bef374d023
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 40 additions and 2 deletions

View File

@ -0,0 +1,38 @@
##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2026, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
##########################################################################
"""
Updated id column type to BIGINT.
Revision ID: 018e16dad6aa
Revises: efbbe5d5862f
Create Date: 2026-01-08 14:37:33.257002
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = '018e16dad6aa'
down_revision = 'efbbe5d5862f'
branch_labels = None
depends_on = None
def upgrade():
with op.batch_alter_table("database") as batch_op:
batch_op.alter_column('id',
existing_type=sa.Integer(),
type_=sa.BigInteger(),
nullable=False)
def downgrade():
# pgAdmin only upgrades, downgrade not implemented.
pass

View File

@ -33,7 +33,7 @@ import config
#
##########################################################################
SCHEMA_VERSION = 48
SCHEMA_VERSION = 49
##########################################################################
#
@ -412,7 +412,7 @@ class Database(db.Model):
Define a Database.
"""
__tablename__ = 'database'
id = db.Column(db.Integer, primary_key=True)
id = db.Column(db.BigInteger, primary_key=True)
schema_res = db.Column(db.String(256), nullable=True)
server = db.Column(
db.Integer,